%PDF- %PDF-
Direktori : /var/www/html/hrsys/api/database/migrations/ |
Current File : /var/www/html/hrsys/api/database/migrations/2020_03_23_202231_create_user_project_table.php |
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateUserProjectTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('user_project', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('user_id') ->index(); $table->foreign('user_id') ->references('id') ->on('users'); $table->unsignedBigInteger('project_id') ->index(); $table->foreign('project_id') ->references('id') ->on('projects'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('user_project'); } }