-
Notifications
You must be signed in to change notification settings - Fork 29
Fix #39: adds the schema.sql for initialising tables and relationships #42
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CREATE TABLE user_info ( | ||
id BIGSERIAL NOT NULL PRIMARY KEY, | ||
name VARCHAR(50) NOT NULL, | ||
age SMALLINT NOT NULL CHECK(age > 0), | ||
year SMALLINT NOT NULL CHECK(year IN (1,2,3,4)), | ||
branch VARCHAR(50) NOT NULL CHECK(branch IN ('CSE','ECE','MECH','SM','BDES')), | ||
bio VARCHAR(500), | ||
image VARCHAR(200), | ||
public_key VARCHAR(500) NOT NULL | ||
); | ||
|
||
CREATE TABLE tags_table ( | ||
id BIGSERIAL NOT NULL PRIMARY KEY, | ||
name VARCHAR(50) NOT NULL | ||
); | ||
|
||
CREATE TABLE tags_user_table ( | ||
tag_id BIGINT NOT NULL REFERENCES tags_table(id), | ||
user_id BIGINT NOT NULL REFERENCES user_info(id) | ||
); | ||
|
||
CREATE TABLE choices_for_chooser ( | ||
chooser_id BIGINT NOT NULL REFERENCES user_info(id), | ||
chosen_id BIGINT REFERENCES user_info(id), | ||
|
||
UNIQUE (chooser_id) | ||
); | ||
|
||
CREATE TABLE choices_for_chosen ( | ||
chosen_id BIGINT NOT NULL REFERENCES user_info(id), | ||
chooser_id BIGINT REFERENCES user_info(id), | ||
|
||
UNIQUE (chosen_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.
change to dob.