Page MenuHomePhorge

2023_03_05_100000_fs_relations_table.php
No OneTemporary

Size
1018 B
Referenced Files
None
Subscribers
None

2023_03_05_100000_fs_relations_table.php

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Schema::create(
'fs_relations',
function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('item_id', 36);
$table->string('related_id', 36);
$table->foreign('item_id')->references('id')->on('fs_items')
->onDelete('cascade');
$table->foreign('related_id')->references('id')->on('fs_items')
->onDelete('cascade');
$table->unique(['item_id', 'related_id']);
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::dropIfExists('fs_relations');
}
};

File Metadata

Mime Type
text/x-php
Expires
Tue, Sep 29, 1:33 AM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1455360
Default Alt Text
2023_03_05_100000_fs_relations_table.php (1018 B)

Event Timeline