Nodelist import
This commit is contained in:
39
database/migrations/2019_04_16_105256_create_flag_node.php
Normal file
39
database/migrations/2019_04_16_105256_create_flag_node.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateFlagNode extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('flag_node');
|
||||
Schema::create('flag_node', function (Blueprint $table) {
|
||||
$table->integer('flag_id');
|
||||
$table->integer('node_id');
|
||||
$table->string('arguments')->nullable();
|
||||
|
||||
$table->index('node_id');
|
||||
$table->index('flag_id');
|
||||
$table->unique(['node_id','flag_id']);
|
||||
$table->foreign('node_id')->references('id')->on('nodes');
|
||||
$table->foreign('flag_id')->references('id')->on('flags');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('flag_node');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user