1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-08 06:45:59 +02:00
tldr/pages/common/sequelize.md
Managor 8e09a08059
common*: refresh old pages part 3 (#16257)
Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com>
2025-04-25 21:19:03 +03:00

24 lines
629 B
Markdown

# 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:migrate`
- Revert all migrations:
`sequelize db:migrate:undo:all`
- Create 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:all`