Merge branch 'master' of https://gitlab.com/willamall/willamall-admin
commit
e5eee7a7ce
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreateModuleUser extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$dbName = config('core.db_name');
|
||||||
|
Schema::create("$dbName.module_user", function (Blueprint $table) {
|
||||||
|
$table->unsignedInteger('module_id');
|
||||||
|
$table->unsignedInteger('user_id');
|
||||||
|
$table->unique(['module_id', 'user_id']);
|
||||||
|
$table->index('module_id');
|
||||||
|
$table->index('user_id');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$dbName = config('core.db_name');
|
||||||
|
Schema::dropIfExists("$dbName.module_user");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue