generated from CodeYourFuture/cyf-final-project-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #38 from gla6-fp-team1/DB-1_and_AUTH-4-1
- Loading branch information
Showing
3 changed files
with
69 additions
and
26 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
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,42 @@ | ||
|
||
/* gla6-fp-team1 week 1 Investigate the database schema ticket*/ | ||
|
||
sentences { | ||
id INT PK, | ||
sentence TEXT, | ||
source TEXT, | ||
count INT | ||
|
||
} | ||
|
||
sentences--0NE ||--MANY{ suggesions : have} | ||
|
||
suggesions { | ||
id INT PK, | ||
sentence_id INT REFERENCES sentences(id), | ||
suggestion TEXT | ||
} | ||
suggesions --ONE || --ONE { sentence : correspond to} | ||
user_interactions{ | ||
id SERIAL PRIMARY KEY, | ||
sentence_id INTEGER REFERENCES sentences(id), | ||
selected_suggestion TEXT, | ||
user_provided_suggestion TEXT | ||
} | ||
user_interactions --ONE || ONE {sentence : correspond to} | ||
CREATE TABLE sentences ( | ||
id SERIAL PRIMARY KEY, | ||
sentence TEXT | ||
); | ||
CREATE TABLE suggestions ( | ||
id SERIAL PRIMARY KEY, | ||
sentence_id INTEGER REFERENCES sentences(id), | ||
suggestion TEXT | ||
); | ||
CREATE TABLE user_interactions ( | ||
id SERIAL PRIMARY KEY, | ||
sentence_id INTEGER REFERENCES sentences(id), | ||
selected_suggestion TEXT, | ||
user_provided_suggestion TEXT | ||
); |