瀏覽代碼

Update migrations

Daniel Supernault 1 年之前
父節點
當前提交
7b6c9c7428

+ 1 - 0
database/migrations/2023_12_27_081801_create_user_roles_table.php

@@ -16,6 +16,7 @@ return new class extends Migration
             $table->unsignedBigInteger('profile_id')->unique()->index();
             $table->unsignedBigInteger('profile_id')->unique()->index();
             $table->unsignedInteger('user_id')->unique()->index();
             $table->unsignedInteger('user_id')->unique()->index();
             $table->json('roles')->nullable();
             $table->json('roles')->nullable();
+            $table->json('meta')->nullable();
             $table->timestamps();
             $table->timestamps();
         });
         });
     }
     }

+ 4 - 0
database/migrations/2023_12_27_082024_add_has_roles_to_users_table.php

@@ -13,6 +13,8 @@ return new class extends Migration
     {
     {
         Schema::table('users', function (Blueprint $table) {
         Schema::table('users', function (Blueprint $table) {
             $table->boolean('has_roles')->default(false);
             $table->boolean('has_roles')->default(false);
+            $table->unsignedInteger('parent_id')->nullable();
+            $table->tinyInteger('role_id')->unsigned()->nullable()->index();
         });
         });
     }
     }
 
 
@@ -23,6 +25,8 @@ return new class extends Migration
     {
     {
         Schema::table('users', function (Blueprint $table) {
         Schema::table('users', function (Blueprint $table) {
             $table->dropColumn('has_roles');
             $table->dropColumn('has_roles');
+            $table->dropColumn('parent_id');
+            $table->dropColumn('role_id');
         });
         });
     }
     }
 };
 };