Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hackademymx/node-express-sql-boilerplate-with-docker
https://github.com/hackademymx/node-express-sql-boilerplate-with-docker
Last synced: about 24 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/hackademymx/node-express-sql-boilerplate-with-docker
- Owner: hackademymx
- Created: 2019-11-28T03:59:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T02:25:54.000Z (over 1 year ago)
- Last Synced: 2024-03-20T04:10:43.303Z (8 months ago)
- Language: JavaScript
- Size: 727 KB
- Stars: 4
- Watchers: 5
- Forks: 2
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Run project
docker-compose -f docker-compose-dev.yml up --build
# Access to container
docker exec -ti -u root #container_id /bin/bash
# Generate model
npx sequelize-cli model:generate --name teachers --attributes firstName:string,lastName:string,email:string,age:integer
# Execute Migrate
sequelize db:migrate --url "postgres://user_db:tupass@postgres:5432/boilerplate_db"
# Create new migration
npx sequelize-cli migration:create --name modify_users_add_new_fields
---
npx sequelize-cli model:generate --name teachers --attributes firstName:string,lastName:string,email:string,age:integer
npx sequelize-cli model:generate --name courses --attributes name:string,credits:integer
npx sequelize-cli model:generate --name courseTeachers --attributes teacherId:integer,courseId:integer
# Association
https://sequelize.org/master/manual/assocs.html#:~:text=To%20do%20this%2C%20Sequelize%20provides,The%20BelongsToMany%20association
- Affect the migrations to ref the tables