Add private event invitations

This commit is contained in:
kai
2026-08-26 18:24:22 +02:00
parent a9741b6859
commit c4fa6f077c
9 changed files with 268 additions and 40 deletions
+13
View File
@@ -109,10 +109,23 @@ CREATE TABLE concerts (
ticket_price NUMERIC(10,2),
flyer_path TEXT,
flyer_url TEXT,
visibility VARCHAR(20) NOT NULL DEFAULT 'public'
CHECK (visibility IN ('public', 'friends', 'private')),
created_by INTEGER REFERENCES users(id) ON DELETE SET NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE event_invitations (
concert_id INTEGER NOT NULL REFERENCES concerts(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
invited_by INTEGER REFERENCES users(id) ON DELETE SET NULL,
viewed_at TIMESTAMP,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (concert_id, user_id)
);
CREATE INDEX idx_event_invitations_user ON event_invitations (user_id, viewed_at);
CREATE TABLE concert_comments (
id SERIAL PRIMARY KEY,
concert_id INTEGER NOT NULL REFERENCES concerts(id) ON DELETE CASCADE,