不要怂,就是干,撸起袖子干!

Commit 444f06f5 by Fernando-Rodriguez Committed by GitHub

docs(migrations.md): grammar improvements (#13294)

1 parent b33d78eb
Showing with 8 additions and 8 deletions
...@@ -93,7 +93,7 @@ This will: ...@@ -93,7 +93,7 @@ This will:
## Running Migrations ## Running Migrations
Until this step, we haven't inserted anything into the database. We have just created required model and migration files for our first model `User`. Now to actually create that table in database you need to run `db:migrate` command. Until this step, we haven't inserted anything into the database. We have just created the required model and migration files for our first model, `User`. Now to actually create that table in the database you need to run `db:migrate` command.
```text ```text
npx sequelize-cli db:migrate npx sequelize-cli db:migrate
...@@ -107,15 +107,15 @@ This command will execute these steps: ...@@ -107,15 +107,15 @@ This command will execute these steps:
## Undoing Migrations ## Undoing Migrations
Now our table has been created and saved in database. With migration you can revert to old state by just running a command. Now our table has been created and saved in the database. With migration you can revert to old state by just running a command.
You can use `db:migrate:undo`, this command will revert most recent migration. You can use `db:migrate:undo`, this command will revert most the recent migration.
```text ```text
npx sequelize-cli db:migrate:undo npx sequelize-cli db:migrate:undo
``` ```
You can revert back to initial state by undoing all migrations with `db:migrate:undo:all` command. You can also revert back to a specific migration by passing its name in `--to` option. You can revert back to the initial state by undoing all migrations with the `db:migrate:undo:all` command. You can also revert back to a specific migration by passing its name with the `--to` option.
```text ```text
npx sequelize-cli db:migrate:undo:all --to XXXXXXXXXXXXXX-create-posts.js npx sequelize-cli db:migrate:undo:all --to XXXXXXXXXXXXXX-create-posts.js
...@@ -123,9 +123,9 @@ npx sequelize-cli db:migrate:undo:all --to XXXXXXXXXXXXXX-create-posts.js ...@@ -123,9 +123,9 @@ npx sequelize-cli db:migrate:undo:all --to XXXXXXXXXXXXXX-create-posts.js
### Creating the first Seed ### Creating the first Seed
Suppose we want to insert some data into a few tables by default. If we follow up on previous example we can consider creating a demo user for `User` table. Suppose we want to insert some data into a few tables by default. If we follow up on the previous example we can consider creating a demo user for the `User` table.
To manage all data migrations you can use seeders. Seed files are some change in data that can be used to populate database table with sample data or test data. To manage all data migrations you can use seeders. Seed files are some change in data that can be used to populate database tables with sample or test data.
Let's create a seed file which will add a demo user to our `User` table. Let's create a seed file which will add a demo user to our `User` table.
...@@ -156,13 +156,13 @@ module.exports = { ...@@ -156,13 +156,13 @@ module.exports = {
## Running Seeds ## Running Seeds
In last step you have create a seed file. It's still not committed to database. To do that we need to run a simple command. In last step you created a seed file; however, it has not been committed to the database. To do that we run a simple command.
```text ```text
npx sequelize-cli db:seed:all npx sequelize-cli db:seed:all
``` ```
This will execute that seed file and you will have a demo user inserted into `User` table. This will execute that seed file and a demo user will be inserted into the `User` table.
**Note:** _Seeder execution history is not stored anywhere, unlike migrations, which use the `SequelizeMeta` table. If you wish to change this behavior, please read the `Storage` section._ **Note:** _Seeder execution history is not stored anywhere, unlike migrations, which use the `SequelizeMeta` table. If you wish to change this behavior, please read the `Storage` section._
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!