-
Notifications
You must be signed in to change notification settings - Fork 3
feature: created docs for setting up db, creating models, and running migrations #43
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
base: main
Are you sure you want to change the base?
feature: created docs for setting up db, creating models, and running migrations #43
Conversation
git commit "merging upstream main into feature/db-docs"
docs/DATABASE_SETUP.md
Outdated
|
|
||
| ### Creating a database | ||
|
|
||
| Once your dev containers are running and you are inside the container, it is easy to create a development database. |
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.
I am thinking about changing Once your dev containers to Once your dev container since the latter part of the sentence is talking about a single container?
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.
Yeah I think the statement is correct because we would have containers running for our chatbot_db and chatbot_server, so I would need to correct the statement to Once your dev containers are running and you are inside the chatbot_server container to show emphasis on where we will be creating tables in our db.
Thank you for pointing that out, Saumil.
docs/MIGRATIONS.md
Outdated
| 202405121234-test.js ==> 202405121234-test.cjs | ||
| ``` | ||
|
|
||
| `*.js` files are set up to have a linting error if we use CommonJS style imports and exports, so `*.cjs` is used be explicit about the fact that we are using a different workflow from the rest of the project. |
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.
Should we change used be explicit to used to be explicit
docs/MIGRATIONS.md
Outdated
|
|
||
| Below is the body of a sample migration to use as an example. Note that | ||
| the underlying Postgresql table should have **snake_cased** column names, | ||
| but that the table attributes should be **camelCase**. There is currently no way to appropriately set the table to handle auto-updating the `created_at` timestamp, but our models will take of it automatically. |
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.
Not sure about models will take of it automatically
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.
Yeah I need to correct that, thank you!
docs/MODELS.md
Outdated
| First, create a new model in `src/models`. | ||
|
|
||
| ```bash | ||
| touch src/models myModel.js(the name of your model) # Models should be camelCase |
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.
Suggest separating shell commands from inline comments:
touch src/models/myModel.js
(Models should be camelCase)
|
hey @SAUMILDHANKAR, @bootupAbdullah. i updated the docs with the changes requested. Please check it out. Thank you. |
Description
There's a clear guide on how to setup the db, create models, and run migrations.
Type of Change
How Has This Been Tested?
This is a doc update, no tests needed to be run thus far.
Checklist:
Related Issues
Fixes #42