Skip to content

Conversation

@echelonnought
Copy link
Contributor

@echelonnought echelonnought commented Jul 5, 2025

Description

There's a clear guide on how to setup the db, create models, and run migrations.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Other (please describe):

How Has This Been Tested?

This is a doc update, no tests needed to be run thus far.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation (if applicable)

Related Issues

Fixes #42


### Creating a database

Once your dev containers are running and you are inside the container, it is easy to create a development database.
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

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.
Copy link
Collaborator

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


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.
Copy link
Collaborator

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

Copy link
Contributor Author

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
Copy link
Collaborator

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)

@echelonnought
Copy link
Contributor Author

hey @SAUMILDHANKAR, @bootupAbdullah. i updated the docs with the changes requested. Please check it out. Thank you.

@SAUMILDHANKAR SAUMILDHANKAR requested a review from hzhao1003 July 15, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Docs to Setup DB, Run Migrations, and Create Models in the docs folder

3 participants