42 lines
813 B
PHP
42 lines
813 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateSetup extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('setups', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->timestamps();
|
|
|
|
$table->integer('opt_md');
|
|
});
|
|
|
|
Schema::create('node_setup', function (Blueprint $table) {
|
|
$table->integer('node_id');
|
|
$table->foreign('node_id')->references('id')->on('nodes');
|
|
$table->integer('setup_id');
|
|
$table->foreign('setup_id')->references('id')->on('setups');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('node_setup');
|
|
Schema::dropIfExists('setups');
|
|
}
|
|
}
|