- You can create a MODEL and a MIGRATION SCRIPT using the command
node_modules/.bin/sequelize model:create --name Todo --attributes title:string,something:integer
Note that there should not be spaces between the attributes. - This will create a file under
src/db/migrations
and you can then populate the entire script as well as a model undersrc/db/models
. - Next, you can execute the migration script using
node_modules/.bin/sequelize db:migrate
- You can execute a rollback with
node_modules/.bin/sequelize db:migrate:undo
- go to
config/docker
and rundocker-compose up
- yarn start
- Sequelize's configuration file path is declared in
.sequelizerc
- folders and files were generated with
yarn sequelize init
- This will generate 3 folders/file,
config.json
,migration
folder andmodels
folder. config.json
will contain the username and password for the database connection.