-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2071 from antgonza/fix-969-db
database changes to fix 969
- Loading branch information
Showing
5 changed files
with
2,002 additions
and
1,704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- Feb 3, 2017 | ||
-- adding study tagging system | ||
|
||
CREATE TABLE qiita.study_tags ( | ||
study_tag_id bigserial NOT NULL, | ||
email varchar NOT NULL, | ||
study_tag varchar NOT NULL, | ||
CONSTRAINT pk_study_tag UNIQUE ( study_tag ), | ||
CONSTRAINT pk_study_tag_id PRIMARY KEY ( study_tag_id ) | ||
) ; | ||
|
||
CREATE INDEX idx_study_tag_id ON qiita.study_tags ( study_tag_id ) ; | ||
ALTER TABLE qiita.study_tags ADD CONSTRAINT fk_study_tags FOREIGN KEY ( email ) REFERENCES qiita.qiita_user( email ); | ||
|
||
CREATE TABLE qiita.per_study_tags ( | ||
study_tag_id bigint NOT NULL, | ||
study_id bigint NOT NULL, | ||
CONSTRAINT pk_per_study_tags PRIMARY KEY ( study_tag_id, study_id ) | ||
) ; |
Oops, something went wrong.