Add private event invitations
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
ALTER TABLE concerts
|
||||
ADD COLUMN IF NOT EXISTS visibility VARCHAR(20) NOT NULL DEFAULT 'public'
|
||||
CHECK (visibility IN ('public', 'friends', 'private'));
|
||||
|
||||
CREATE TABLE IF NOT EXISTS 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 IF NOT EXISTS idx_event_invitations_user
|
||||
ON event_invitations (user_id, viewed_at);
|
||||
Reference in New Issue
Block a user