Executing Database Migrations And Seeds
If you wish to add a new entity with fields without modifying the code, you can effortlessly achieve this through the generator.
For instance, let's say you have added an entity named "EntityExample". After creating this new entity, you will see a notification in the bottom left corner indicating that the database schema has been updated.
When you click the "Save" button, the system will notify you that the "Project has been successfully updated".
Additionally, a new migration file containing information about the created entity "EntityExample" will be created in your GitHub repository
Database Migrations
To execute Database Migrations you need to run the following script:
"db:migrate": "sequelize-cli db:migrate"
Apply Seeds
To start the data-filling process you need to run:
"db:seed": "sequelize-cli db:seed:all"
You can find these and other scripts in the package.json
file:
"db:seed": "sequelize-cli db:seed:all",
"db:drop": "sequelize-cli db:drop",
"db:create": "sequelize-cli db:create"
We use sequelize
for database operations and migrations. To learn how to manually create model migrations and seeds using the CLI, you can visit the Sequelize Migrations Documentation.