Eigene Fotokategorie fuer Grundrisse und Plaene, nie in Galerien
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8bcda9a4bc
commit
d02f3e05c7
7 files changed
+85
-4
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Pictures used by a floor plan move to the new category "Grundriss & Pläne", which galleries never show.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
DB::table('photos')
|
||||
->whereIn('id', DB::table('floor_plans')->whereNotNull('photo_id')->select('photo_id'))
|
||||
->update(['category' => 'plan']);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
DB::table('photos')->where('category', 'plan')->update(['category' => 'apartment']);
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user