文件
catch-the-fish/migrations/2019_04_01_03_create_catchthefish_rankings.php
2026-07-31 00:13:44 +08:00

23 行
777 B
PHP

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->create('catchthefish_rankings', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('round_id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('catch_count')->index();
$table->timestamps();
$table->foreign('round_id')->references('id')->on('catchthefish_rounds')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
},
'down' => function (Builder $schema) {
$schema->dropIfExists('catchthefish_rankings');
},
];