Files
helvoirtgevelreiniging.nl/migrations/0015_locaties_layout.sql
T

57 lines
5.1 KiB
SQL

-- Rijkere opmaak voor locatiepagina's (collectie `locaties`): een optionele hero-foto,
-- 4 vaste content-blokken (kop + alinea + optionele foto, om-en-om getoond) en een
-- aanpasbare CTA-balk. Alles optioneel en door de SEO-partij zelf in te vullen; leeg = wordt
-- niet getoond. Het bestaande veld `content` blijft bestaan en verschuift naar onderaan
-- ("Extra lokale tekst"), zodat bestaande tekst (o.a. /maastricht) niet verloren gaat.
--
-- `locaties` bestaat al (geseed via de wizard) → ALTER TABLE + nieuwe _emdash_fields-rijen,
-- NIET via gen-cms-sql (dat maakt nieuwe tabellen). Veilig dankzij 0014: de kapotte FTS-triggers
-- op ec_locaties zijn weg, dus ALTER/UPDATE op deze tabel werkt nu probleemloos.
-- Toepassen op remote D1:
-- node node_modules/wrangler/bin/wrangler.js d1 execute helvoirt-db --remote --file migrations/0015_locaties_layout.sql
-- ---- 1. Nieuwe kolommen op de content-tabel ----
ALTER TABLE "ec_locaties" ADD COLUMN "hero_image" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok1_heading" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok1_text" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok1_image" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok2_heading" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok2_text" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok2_image" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok3_heading" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok3_text" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok3_image" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok4_heading" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok4_text" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "blok4_image" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "cta_heading" TEXT;
ALTER TABLE "ec_locaties" ADD COLUMN "cta_text" TEXT;
-- ---- 2. Bestaande velden herordenen + `content` herlabelen (schuift naar onderaan) ----
UPDATE _emdash_fields SET sort_order = 18,
label = 'Extra lokale tekst onderaan (optioneel — vrije tekst met koppen/lijsten)'
WHERE collection_id = '01KV7XX3NQG57PFRGRDRB5571M' AND slug = 'content';
UPDATE _emdash_fields SET sort_order = 19 WHERE collection_id = '01KV7XX3NQG57PFRGRDRB5571M' AND slug = 'meta_title';
UPDATE _emdash_fields SET sort_order = 20 WHERE collection_id = '01KV7XX3NQG57PFRGRDRB5571M' AND slug = 'meta_description';
UPDATE _emdash_fields SET sort_order = 21 WHERE collection_id = '01KV7XX3NQG57PFRGRDRB5571M' AND slug = 'canonical';
UPDATE _emdash_fields SET sort_order = 22 WHERE collection_id = '01KV7XX3NQG57PFRGRDRB5571M' AND slug = 'og_image';
UPDATE _emdash_fields SET sort_order = 23 WHERE collection_id = '01KV7XX3NQG57PFRGRDRB5571M' AND slug = 'noindex';
-- ---- 3. Velddefinities voor de nieuwe velden (widget NULL = emdash kiest op type) ----
INSERT INTO _emdash_fields (id, collection_id, slug, label, type, column_type, required, sort_order, searchable, translatable, widget) VALUES
('01KVYY23F7VXW2GD6YJTKQAGXZ', '01KV7XX3NQG57PFRGRDRB5571M', 'hero_image', 'Hero-foto bovenaan (optioneel — leeg = donkere balk zonder foto)', 'image', 'TEXT', 0, 3, 0, 1, NULL),
('01KVYY23F82AW73NMKM3GD1W95', '01KV7XX3NQG57PFRGRDRB5571M', 'blok1_heading', 'Blok 1 · kop', 'string', 'TEXT', 0, 4, 0, 1, NULL),
('01KVYY23F83WB37RTYF78W1YM7', '01KV7XX3NQG57PFRGRDRB5571M', 'blok1_text', 'Blok 1 · tekst (alinea)', 'text', 'TEXT', 0, 5, 0, 1, NULL),
('01KVYY23F8BZNNMG8JZWD9ZYHV', '01KV7XX3NQG57PFRGRDRB5571M', 'blok1_image', 'Blok 1 · foto (optioneel)', 'image', 'TEXT', 0, 6, 0, 1, NULL),
('01KVYY23F819SWRPR7MJPGQWNP', '01KV7XX3NQG57PFRGRDRB5571M', 'blok2_heading', 'Blok 2 · kop', 'string', 'TEXT', 0, 7, 0, 1, NULL),
('01KVYY23F85JM1HRRGHPXNM17Y', '01KV7XX3NQG57PFRGRDRB5571M', 'blok2_text', 'Blok 2 · tekst (alinea)', 'text', 'TEXT', 0, 8, 0, 1, NULL),
('01KVYY23F9ZRMGK2R3YCASMMSC', '01KV7XX3NQG57PFRGRDRB5571M', 'blok2_image', 'Blok 2 · foto (optioneel)', 'image', 'TEXT', 0, 9, 0, 1, NULL),
('01KVYY23F93PJ841HQMT77QM77', '01KV7XX3NQG57PFRGRDRB5571M', 'blok3_heading', 'Blok 3 · kop', 'string', 'TEXT', 0, 10, 0, 1, NULL),
('01KVYY23F9EES7PKTNS6PDQA4F', '01KV7XX3NQG57PFRGRDRB5571M', 'blok3_text', 'Blok 3 · tekst (alinea)', 'text', 'TEXT', 0, 11, 0, 1, NULL),
('01KVYY23F9ES6G9CKCHC1J66MB', '01KV7XX3NQG57PFRGRDRB5571M', 'blok3_image', 'Blok 3 · foto (optioneel)', 'image', 'TEXT', 0, 12, 0, 1, NULL),
('01KVYY23F9AAY29MV7JSBE02DF', '01KV7XX3NQG57PFRGRDRB5571M', 'blok4_heading', 'Blok 4 · kop', 'string', 'TEXT', 0, 13, 0, 1, NULL),
('01KVYY23F93FQBK8XJVY34T59D', '01KV7XX3NQG57PFRGRDRB5571M', 'blok4_text', 'Blok 4 · tekst (alinea)', 'text', 'TEXT', 0, 14, 0, 1, NULL),
('01KVYY23F9FCECQYJJA1XDEJN3', '01KV7XX3NQG57PFRGRDRB5571M', 'blok4_image', 'Blok 4 · foto (optioneel)', 'image', 'TEXT', 0, 15, 0, 1, NULL),
('01KVYY23F98SHEN873B4GJMM0A', '01KV7XX3NQG57PFRGRDRB5571M', 'cta_heading', 'CTA-balk · kop (optioneel — blauwe oproepbalk)', 'string', 'TEXT', 0, 16, 0, 1, NULL),
('01KVYY23F9D7QBQPF0PQRC54MZ', '01KV7XX3NQG57PFRGRDRB5571M', 'cta_text', 'CTA-balk · tekst (optioneel)', 'text', 'TEXT', 0, 17, 0, 1, NULL);