added role_user migration..
This commit is contained in:
parent
70f53b6355
commit
16c645b4a0
@ -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
|
||||
|
35
database/migrations/2022_07_21_000000_core_v305.php
Normal file
35
database/migrations/2022_07_21_000000_core_v305.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('user_roles', function (Blueprint $table) {
|
||||
$table->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()
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user