23 lines
622 B
PHP
23 lines
622 B
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(): void {
|
|
Schema::create('media', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->morphs('mediable'); // mediable_type, mediable_id
|
|
$table->string('file_path');
|
|
$table->string('file_name');
|
|
$table->string('mime_type');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void {
|
|
Schema::dropIfExists('media');
|
|
}
|
|
};
|