diff --git a/composer.json b/composer.json index 43c8c80..ec480fc 100755 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "license": "MIT", "require": { "php": "^7.1.3", + "doctrine/dbal": "^2.9", "fideloper/proxy": "^4.0", "laravel/framework": "5.8.*", "laravel/passport": "^7.3", diff --git a/database/migrations/2019_08_23_152615_create_module_user.php b/database/migrations/2019_08_23_152615_create_module_user.php new file mode 100644 index 0000000..5cd4a85 --- /dev/null +++ b/database/migrations/2019_08_23_152615_create_module_user.php @@ -0,0 +1,37 @@ +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"); + } +}