Files
construprogress/database/migrations/2026_05_09_210000_create_media_table.php
Javier Braña 90630379fb chore: cleanup dead code + format with Pint
- Remove unused FeaturesController (empty stubs, no routes)
- Remove ConvertSpatialFile CLI command (unused; service used in LayerManager)
- Remove MigrateGeojsonToFeatures CLI command (one-shot migration, not referenced)
- Remove .claude/worktrees/ (11 old agent worktrees from June)
- Apply Laravel Pint formatting across 219 files (style only, no functional changes)

Tests: 101 passing (319 assertions)
API routes: unchanged (8 routes intact)
2026-08-28 13:04:28 +02:00

34 lines
1.2 KiB
PHP

<?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('media', function (Blueprint $table) {
$table->id();
$table->uuid('uuid')->nullable()->unique();
$table->morphs('mediable'); // project, phase, layer, feature
$table->string('name');
$table->string('file_path');
$table->string('file_type'); // image/jpeg, application/pdf, etc.
$table->string('file_extension', 10);
$table->unsignedInteger('file_size');
$table->enum('category', ['image', 'document', 'other'])->default('image');
$table->text('description')->nullable();
$table->json('metadata')->nullable(); // EXIF, GPS coords, etc.
$table->foreignId('uploaded_by')->constrained('users');
$table->timestamp('client_updated_at')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('media');
}
};