hasTable("user_registration_requests")){ $builder->create('user_registration_requests', function (Table $table) { $table->increments('id'); $table->timestamps(); $table->timestamp("redeem_at")->setNotnull(false); $table->text('hash'); $table->string("first_name", 100)->setNotnull(false); $table->string("last_name", 100)->setNotnull(false); $table->string("email", 255)->setNotnull(false); $table->string("country_iso_code", 2)->setNotnull(false); // user associated after creation $table->bigInteger("user_id")->setUnsigned(true)->setNotnull(false); $table->index("user_id", "user_id"); $table->foreign("users", "user_id", "id", ["onDelete" => "CASCADE"]); // origination oauth2 client $table->bigInteger("client_id")->setUnsigned(true)->setNotnull(false); $table->index("client_id", "client_id"); $table->foreign("oauth2_client", "client_id", "id", ["onDelete" => "CASCADE"]); }); } } /** * @param Schema $schema */ public function down(Schema $schema) { $schema->dropTable("user_registration_requests"); } }