Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tjarvstrand/3c31c39f1aab0f5c1f8e3d39b1e08483 to your computer and use it in GitHub Desktop.
Save tjarvstrand/3c31c39f1aab0f5c1f8e3d39b1e08483 to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS event_user_invitation (
event_id TEXT NOT NULL REFERENCES event(id) ON DELETE CASCADE,
invited_user_id TEXT NOT NULL REFERENCES user$(id) ON DELETE CASCADE,
invited_group_id TEXT REFERENCES friend_group(id) ON DELETE CASCADE,
inviting_user_id TEXT NOT NULL REFERENCES user$(id) ON DELETE CASCADE,
created_at TIMESTAMP NOT NULL,
PRIMARY KEY (event_id, invited_user_id, inviting_user_id)
);
CREATE TABLE IF NOT EXISTS event_group_invitation (
event_id TEXT NOT NULL REFERENCES event(id) ON DELETE CASCADE,
invited_group_id TEXT REFERENCES friend_group(id) ON DELETE CASCADE,
created_at TIMESTAMP NOT NULL,
PRIMARY KEY (event_id, invited_group_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment