first commit
This commit is contained in:
35
database/migrations/2018_09_20_214840_create_pilots_table.php
Executable file
35
database/migrations/2018_09_20_214840_create_pilots_table.php
Executable file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePilotsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pilots', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('first_name');
|
||||
$table->integer('kart_id')->unsigned();
|
||||
$table->foreign('kart_id')->references('id')->on('karts')->onDelete('no action');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pilots');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user