feature: created docs for setting up db, creating models, and running migrations#43
feature: created docs for setting up db, creating models, and running migrations#43echelonnought wants to merge 4 commits intoOpenSourceFellows:mainfrom
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.
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.
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.
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.
Not sure about models will take of it automatically
There was a problem hiding this comment.
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.
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