このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
kikikan/backend/database/migrations/2021_08_13_053246_create_fa...

37 行
958 B
PHP

<?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) {
$table->id();
$table->unsignedBigInteger('father_id');
$table->foreign('father_id')->references('id')->on('fathers')->onDelete('cascade');
$table->unsignedBigInteger('child_id');
$table->foreign('child_id')->references('id')->on('children')->onDelete('cascade');
$table->dateTime('hire_at')->useCurrent();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('father_relations');
}
}