Add a featured event as a hero option
Front page → Feature gains "Featured event" (migration 033): the event's card beside the headline, with its photo or colour, dates or schedule, place, tagline, action buttons and a link to its page, under a "Featured event" badge, over either backdrop. Front page → Featured event pins one. Blank uses the countdown's event, and a pinned event that's over or unpublished falls back to it, so the hero and the countdown never disagree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
29202f2eb1
commit
d6477b6d30
7 changed files with 187 additions and 11 deletions
34
server/src/migrations/033_hero_event.sql
Normal file
34
server/src/migrations/033_hero_event.sql
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
-- ═══════════════════════════════════════════════════════════════
|
||||
-- 033 HERO: A FEATURED EVENT
|
||||
--
|
||||
-- A fourth hero feature, 'event': an event's card beside the
|
||||
-- headline, over whichever backdrop is chosen.
|
||||
--
|
||||
-- hero_event_id the event to feature. Null means the event the
|
||||
-- countdown shows (its pin, or the next one that
|
||||
-- hasn't ended, narrowed by its scope and type),
|
||||
-- so the hero and the countdown can't disagree.
|
||||
-- A pinned event that is over, unpublished or
|
||||
-- deleted falls back the same way; ON DELETE SET
|
||||
-- NULL does the last one.
|
||||
--
|
||||
-- hero_feature's CHECK gains 'event'. A CHECK can't be altered in
|
||||
-- place, so the column is replaced the way 025 did it: a new column
|
||||
-- with the new CHECK, the values copied across, the old one dropped
|
||||
-- and the new one renamed into its place. Nothing else names the
|
||||
-- column, so front_page itself needn't be rebuilt.
|
||||
--
|
||||
-- PRAGMA user_version; -- reads 32 before this file
|
||||
-- ═══════════════════════════════════════════════════════════════
|
||||
|
||||
ALTER TABLE front_page ADD COLUMN hero_feature_new TEXT NOT NULL DEFAULT 'none'
|
||||
CHECK (hero_feature_new IN ('none', 'livestream', 'video', 'event'));
|
||||
|
||||
UPDATE front_page SET hero_feature_new = hero_feature;
|
||||
|
||||
ALTER TABLE front_page DROP COLUMN hero_feature;
|
||||
|
||||
ALTER TABLE front_page RENAME COLUMN hero_feature_new TO hero_feature;
|
||||
|
||||
ALTER TABLE front_page ADD COLUMN hero_event_id TEXT
|
||||
REFERENCES events (id) ON DELETE SET NULL;
|
||||
Loading…
Add table
Add a link
Reference in a new issue