Configured the removal of old files that were not attached to the model or were marked as deleted.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?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::table('storage', function (Blueprint $table) {
|
||||
$table->dropIndex(['morph_id']);
|
||||
$table->index(['morph_id', 'updated_at']);
|
||||
$table->index(['deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('storage', function (Blueprint $table) {
|
||||
$table->dropIndex(['morph_id', 'updated_at']);
|
||||
$table->dropIndex(['deleted_at']);
|
||||
$table->index(['morph_id']);
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user