HifiPlanet-Website/hifi/api/database/migration_brand_model_images.sql
Maaxxs b2b7e0a8d6 Add image support for car brands and models
Phase 3 of the dashboard roadmap. Adds brands.image_path and
car_models.image_path, following the exact same pattern as the
existing gallery cover-image columns: Schema.php (create + additive
migration), the export/import wiring (TABLE_COLUMNS + IMAGE_COLUMNS,
so the files survive an export/import round-trip), orphaned-file
cleanup via the Phase 1 Uploads helper (including brand deletes, which
cascade-delete their models), and an ImageUploadField in both admin
pages with a thumbnail column in the tables.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 01:42:40 +02:00

12 lines
515 B
SQL

USE hifi_shop;
-- Bild pro Automarke und Modell (z.B. Logo bzw. Fahrzeugfoto), analog zu den bereits
-- bestehenden Bild-Spalten bei der Bildergalerie. Additiv, nichts wird geloescht.
-- Hinweis: Auf der Live-Seite reicht stattdessen ein Klick auf "Datenbankstruktur aktualisieren"
-- unter Admin-Panel -> Einstellungen -> Datenbank.
ALTER TABLE brands
ADD COLUMN IF NOT EXISTS image_path VARCHAR(255) NULL AFTER slug;
ALTER TABLE car_models
ADD COLUMN IF NOT EXISTS image_path VARCHAR(255) NULL AFTER slug;