2026-05-07 23:31:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
|
|
return new class extends Migration
|
|
|
|
|
{
|
|
|
|
|
public function up()
|
|
|
|
|
{
|
|
|
|
|
Schema::create('layers', function (Blueprint $table) {
|
|
|
|
|
$table->id();
|
|
|
|
|
$table->foreignId('project_id')->constrained()->onDelete('cascade');
|
|
|
|
|
$table->foreignId('phase_id')->nullable()->constrained()->onDelete('set null');
|
|
|
|
|
$table->string('name');
|
2026-06-19 18:40:54 +02:00
|
|
|
$table->string('color', 7)->default('#3b82f6');
|
2026-05-07 23:31:33 +02:00
|
|
|
$table->string('original_file')->nullable(); // path to original uploaded file
|
|
|
|
|
$table->foreignId('uploaded_by')->constrained('users');
|
|
|
|
|
$table->timestamps();
|
2026-06-19 18:40:54 +02:00
|
|
|
$table->softDeletes();
|
2026-05-07 23:31:33 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('layers');
|
|
|
|
|
}
|
|
|
|
|
};
|