-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: create polls schema #2418
Conversation
JIRA ticket: EC-6891 |
Preview deployment: https://pr-2418.portal-js.dev.eanadev.org/ |
CREATE SCHEMA polls; | ||
SET search_path TO polls; | ||
|
||
CREATE TABLE options ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to candidates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this will also help avoid confusion in various places where functions are passing "options" around.
external_id VARCHAR(100) NOT NULL UNIQUE | ||
); | ||
|
||
CREATE TABLE users ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to voters
UNIQUE(user_id, option_id) | ||
); | ||
|
||
CREATE INDEX ix_option_id ON polls.votes(option_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index names should follow the pattern used in the events schema, i.e. ix_[TABLE]_[COLUMN]
, e.g. ix_votes_user_id
|
No description provided.