Files
cssd-back/database/migrations/2019_04_11_105057_create_inputs_table.php
T
2019-04-18 20:18:13 +04:30

40 lines
1013 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInputsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('inputs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('type');
$table->unsignedBigInteger('test_type_id');
$table->foreign('test_type_id')->references('id')->on('test_types');
$table->unsignedBigInteger('parent_id')->nullable();
$table->foreign('parent_id')->references('id')->on('inputs');
$table->string('size');
$table->string('value');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('inputs');
}
}