snippetbashTip
sequelize — Promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. More infor
Viewed 0 times
commandnodeormclibasedforsequelizepromise
Problem
How to use the
sequelize command: Promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. More information: <https://sequelize.org/docs/v7/cli/>.Solution
sequelize — Promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. More information: <https://sequelize.org/docs/v7/cli/>.Create a model with 3 fields and a migration file:
sequelize model:generate --name {{table_name}} --attributes {{field1:integer,field2:string,field3:boolean}}Run the migration file:
sequelize db:migrateRevert all migrations:
sequelize db:migrate:undo:allCreate a seed file with the specified name to populate the database:
sequelize seed:generate --name {{seed_filename}}Populate database using all seed files:
sequelize db:seed:allCode Snippets
Create a model with 3 fields and a migration file
sequelize model:generate --name {{table_name}} --attributes {{field1:integer,field2:string,field3:boolean}}Run the migration file
sequelize db:migrateRevert all migrations
sequelize db:migrate:undo:allCreate a seed file with the specified name to populate the database
sequelize seed:generate --name {{seed_filename}}Populate database using all seed files
sequelize db:seed:allContext
tldr-pages: common/sequelize
Revisions (0)
No revisions yet.