Rework TIC processing to use Storage::disk(). Implemented handling of replaces and files that already exist
This commit is contained in:
34
database/migrations/2023_09_22_233947_file_tweeks.php
Normal file
34
database/migrations/2023_09_22_233947_file_tweeks.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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('files', function (Blueprint $table) {
|
||||
$table->dropUnique(['filearea_id','name']);
|
||||
$table->string('replaces')->nullable();
|
||||
});
|
||||
|
||||
DB::statement("CREATE UNIQUE INDEX files_active ON files (filearea_id, name) WHERE deleted_at IS NULL");
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
DB::statement("DROP INDEX files_active");
|
||||
|
||||
Schema::table('files', function (Blueprint $table) {
|
||||
$table->unique(['filearea_id','name']);
|
||||
$table->dropColumn('replaces');
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user