Added page authorisation and cug processing
This commit is contained in:
38
database/migrations/2018_12_10_211904_create_user_cug.php
Normal file
38
database/migrations/2018_12_10_211904_create_user_cug.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUserCug extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->down();
|
||||
|
||||
Schema::create('cug_users', function (Blueprint $table) {
|
||||
$table->integer('cug_id');
|
||||
$table->integer('user_id')->unsigned();
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->foreign('cug_id')->references('id')->on('cugs');
|
||||
$table->unique(['user_id','cug_id']);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cug_users');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user