-
Notifications
You must be signed in to change notification settings - Fork 1
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
#27 and #34- store each suggestion with unique id and alter sentences table - Appolin Semegni Fotso #38
Conversation
…fetch randomtext from the database
…e it in suggestion and user_interaction tables
Your Render PR Server URL is https://gaelic-project-pr-38.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-ckjd18sl4vmc73akpka0. |
sentence_id INTEGER REFERENCES sentences(id), | ||
selected_suggestion TEXT, | ||
user_provided_suggestion TEXT | ||
); |
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.
whenever you update the schema it is also customary to provide update scripts - otherwise people will need to delete and re-create the database from scratch. This is not a problem right now, but could become an issue in the future once the project is live
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.
Also we should provide some test data - a couple of INSERT INTOs of the existing sentence data for example to make sure we have enough data to start with. Something like
INSERT INTO sentences (sentence) VALUES ('Tha iad ris an Gearrloch fhathast.');
While there are some issues with this PR I will commit it as it includes a couple important architectural changes that should be in
|
…ery-performance #38 - Query performance and Database setup script - Appolin Semegni Fotso
Naming Rules
Name your PR like this: ISSUENUMBER-TITLE-YOURNAME
Description
I parsed the body of the fetch POST API into JSON so that each suggestion can be stored with its unique id when inserting them into the suggestions table. I added a source and a count columns to the sentences table and I inserted the hard-coded array of text into the sentences table so that random text can be query from the database. I added appropriate queries to endpoints in api.js file.
Related to
Make sure you include the issue number with a hash sign # so Github can link this PR to the right issue, like this:
Fixes #27 and #34
Checklist: