File tree Expand file tree Collapse file tree
app/sprinkles/account/src/Database/Migrations/v430 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 *
2121 * See https://laravel.com/docs/5.4/migrations#tables
2222 *
23- * @author Alex Weissman (https://alexanderweissman.com)
23+ * @author Amos Folz
2424 */
2525class 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}
You can’t perform that action at this time.
0 commit comments