nordabiz/database/migrations/105_add_event_date_end.sql
Maciej Pienczyn eaac876ec2
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
feat(calendar): multi-day events + **bold** w opisach wydarzeń
- norda_events: kolumna event_date_end (NULLABLE, check constraint >= event_date)
- NordaEvent: property is_multi_day, date_range_display; is_past uwzględnia koniec
- Admin (new/edit): pole "Data zakończenia" w formularzu
- Calendar grid: wydarzenie wielodniowe wyświetla się na każdym dniu zakresu
- Upcoming/past filter: używa COALESCE(end, date) — 2-dniowe zostaje w Upcoming
  do swojego ostatniego dnia
- event.html: "Termin" + zakres dla wielodniowych; ICS/Google end date z dateEnd
- Lekki markdown dla opisów: tylko **bold** → <strong> (audyt: tylko event #60)

Zero wpływu na 42 istniejące wydarzenia (NULL == stare zachowanie).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:52:31 +02:00

17 lines
658 B
SQL

-- Migration 105: Add event_date_end for multi-day events
-- Dodaje opcjonalną datę zakończenia dla wydarzeń wielodniowych (np. targi 19-20.06).
ALTER TABLE norda_events
ADD COLUMN IF NOT EXISTS event_date_end DATE;
COMMENT ON COLUMN norda_events.event_date_end IS
'Data zakończenia wydarzenia (NULL = jednodniowe). Musi być >= event_date.';
-- Prosty check constraint: jeśli ustawione, musi być >= event_date
ALTER TABLE norda_events
DROP CONSTRAINT IF EXISTS norda_events_date_range_check;
ALTER TABLE norda_events
ADD CONSTRAINT norda_events_date_range_check
CHECK (event_date_end IS NULL OR event_date_end >= event_date);