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'); }); } };