Skip to content

Commit

Permalink
docs(migrations.md): grammar improvements (sequelize#13294)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-Rodriguez authored and yocontra committed Sep 15, 2021
1 parent a290252 commit e9ba4ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/manual/other-topics/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ This will:

## 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
npx sequelize-cli db:migrate
Expand All @@ -107,25 +107,25 @@ This command will execute these steps:

## 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
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
npx sequelize-cli db:migrate:undo:all --to XXXXXXXXXXXXXX-create-posts.js
```

### 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.

Expand Down Expand Up @@ -156,13 +156,13 @@ module.exports = {

## 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
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._

Expand Down

0 comments on commit e9ba4ee

Please sign in to comment.