feat(calendar): add event_guests migration 096

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-03-31 13:58:27 +02:00
parent 492ca1b01b
commit 96cb134d1f

View File

@ -0,0 +1,18 @@
-- Migration 096: Event Guests
-- Allows users to register accompanying guests for events
CREATE TABLE IF NOT EXISTS event_guests (
id SERIAL PRIMARY KEY,
event_id INTEGER NOT NULL REFERENCES norda_events(id) ON DELETE CASCADE,
host_user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
first_name VARCHAR(100),
last_name VARCHAR(100),
organization VARCHAR(255),
created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS ix_event_guests_event_id ON event_guests(event_id);
CREATE INDEX IF NOT EXISTS ix_event_guests_host_user_id ON event_guests(host_user_id);
GRANT ALL ON TABLE event_guests TO nordabiz_app;
GRANT USAGE, SELECT ON SEQUENCE event_guests_id_seq TO nordabiz_app;