Skip to content

Commit c731414

Browse files
committed
Modify UpdateUsersTable.php
1 parent abe23cc commit c731414

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

app/sprinkles/account/src/Database/Migrations/v430/UpdateUsersTable.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* See https://laravel.com/docs/5.4/migrations#tables
2222
*
23-
* @author Alex Weissman (https://alexanderweissman.com)
23+
* @author Amos Folz
2424
*/
2525
class UpdateUsersTable extends Migration
2626
{
@@ -40,11 +40,7 @@ public function up()
4040
{
4141
if ($this->schema->hasTable('users')) {
4242
$this->schema->table('users', function (Blueprint $table) {
43-
$table->dropForeign(['group_id']);
44-
$table->unsignedInteger('group_id')->default(null)->comment('The id of the user group.')->nullable()->change();
45-
});
46-
$this->schema->table('users', function (Blueprint $table) {
47-
$table->foreign('group_id')->references('id')->on('groups');
43+
$table->unsignedInteger('group_id')->comment('The id of the user group.')->nullable()->change();
4844
});
4945
}
5046
}
@@ -55,11 +51,7 @@ public function up()
5551
public function down()
5652
{
5753
$this->schema->table('users', function (Blueprint $table) {
58-
$table->dropForeign(['group_id']);
5954
$table->unsignedInteger('group_id')->default(1)->comment('The id of the user group.')->nullable(false)->change();
6055
});
61-
$this->schema->table('users', function (Blueprint $table) {
62-
$table->foreign('group_id')->references('id')->on('groups');
63-
});
6456
}
6557
}

0 commit comments

Comments
 (0)