From 7b6c9c7428d704552e38d42314272a1b83967a51 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 1 Jan 2024 16:19:24 -0700 Subject: [PATCH] Update migrations --- .../migrations/2023_12_27_081801_create_user_roles_table.php | 1 + .../2023_12_27_082024_add_has_roles_to_users_table.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/database/migrations/2023_12_27_081801_create_user_roles_table.php b/database/migrations/2023_12_27_081801_create_user_roles_table.php index 4e6af18d0..59b8ab390 100644 --- a/database/migrations/2023_12_27_081801_create_user_roles_table.php +++ b/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->unsignedInteger('user_id')->unique()->index(); $table->json('roles')->nullable(); + $table->json('meta')->nullable(); $table->timestamps(); }); } diff --git a/database/migrations/2023_12_27_082024_add_has_roles_to_users_table.php b/database/migrations/2023_12_27_082024_add_has_roles_to_users_table.php index c60b81deb..09246e37b 100644 --- a/database/migrations/2023_12_27_082024_add_has_roles_to_users_table.php +++ b/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) { $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) { $table->dropColumn('has_roles'); + $table->dropColumn('parent_id'); + $table->dropColumn('role_id'); }); } };