add explicit set levels
This commit is contained in:
parent
7e8850b1b2
commit
0d102fcee0
7 changed files with 223 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('set_levels', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('set_id')
|
||||
->constrained('sets')
|
||||
->cascadeOnDelete();
|
||||
$table->string('kind');
|
||||
$table->unsignedInteger('depth');
|
||||
$table->unique(['set_id', 'kind']);
|
||||
$table->unique(['set_id', 'depth']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('set_levels');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue