diff --git a/database/migrations/2017_09_14_000000_core_v1.php b/database/migrations/2017_09_14_000000_core_v1.php index 047b7fbcc..3525b6ba4 100644 --- a/database/migrations/2017_09_14_000000_core_v1.php +++ b/database/migrations/2017_09_14_000000_core_v1.php @@ -410,11 +410,12 @@ return new class extends Migration Schema::create('user_roles', function (Blueprint $table) { $table->integer('user_id')->unsigned(); $table->integer('role_id')->unsigned(); + $table->string('user_type'); $table->foreign('role_id')->references('id')->on('roles') ->onUpdate('cascade')->onDelete('cascade'); - $table->primary(['user_id', 'role_id']); + $table->primary(['user_id', 'role_id', 'user_type']); }); // Reconciliations diff --git a/database/migrations/2022_07_21_000000_core_v305.php b/database/migrations/2022_07_21_000000_core_v305.php new file mode 100644 index 000000000..c140d0ce5 --- /dev/null +++ b/database/migrations/2022_07_21_000000_core_v305.php @@ -0,0 +1,35 @@ +dropPrimary(['user_id', 'role_id', 'user_type']); + $table->primary(['user_id', 'role_id']); + }); + + Schema::table('user_roles', function (Blueprint $table) { + $table->dropColumn('user_type'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +};