38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('files', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name', 256);
|
|
$table->string('path', 1024)->nullable();
|
|
$table->string('stored_at', 2000)->nullable();
|
|
$table->boolean('s3')->default(0);
|
|
$table->nestedSet();
|
|
$table->boolean('is_folder');
|
|
$table->string('mimetype')->nullable();
|
|
$table->integer('size')->nullable();
|
|
$table->timestamps();
|
|
$table->foreignIdFor(\App\Models\User::class, 'created_by');
|
|
$table->foreignIdFor(\App\Models\User::class, 'updated_by');
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('files');
|
|
}
|
|
};
|