このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
2021-08-13 14:44:08 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CreateFatherRelationsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('father_relations', function (Blueprint $table) {
|
2021-08-13 21:12:02 +09:00
|
|
|
$table->id();
|
|
|
|
$table->unsignedBigInteger('father_id');
|
2021-10-29 22:19:12 +09:00
|
|
|
$table->foreign('father_id')->references('id')->on('fathers')->onDelete('cascade');
|
2021-08-13 21:12:02 +09:00
|
|
|
$table->unsignedBigInteger('child_id');
|
2021-10-29 22:19:12 +09:00
|
|
|
$table->foreign('child_id')->references('id')->on('children')->onDelete('cascade');
|
2021-08-13 23:12:46 +09:00
|
|
|
$table->dateTime('hire_at')->useCurrent();
|
2021-08-13 21:12:02 +09:00
|
|
|
$table->timestamps();
|
2021-08-13 14:44:08 +09:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('father_relations');
|
|
|
|
}
|
|
|
|
}
|