Skip to content
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

Merged
merged 6 commits into from
Aug 19, 2024
Merged

Conversation

lbiedinger
Copy link
Member

No description provided.

Copy link

JIRA ticket: EC-6891

Copy link

Preview deployment: https://pr-2418.portal-js.dev.eanadev.org/

@lbiedinger lbiedinger mentioned this pull request Aug 19, 2024
CREATE SCHEMA polls;
SET search_path TO polls;

CREATE TABLE options (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to candidates

Copy link
Member Author

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 (
Copy link
Contributor

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);
Copy link
Contributor

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

Copy link

@rwd rwd merged commit 7a122f4 into master Aug 19, 2024
16 of 17 checks passed
@rwd rwd deleted the chore/EC-6891-extend-psqldb-for-votes branch August 19, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants