Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/06-concepts/06-database/11-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,16 @@ For each migration, five files are created:

## Apply migrations

Migrations are applied using the server runtime. To apply migrations, navigate to your project's `server` package directory, then start the server with the `--apply-migrations` flag. Migrations are applied as part of the startup sequence and the framework asserts that each migration is only applied once to the database.
### During development

`serverpod start` applies your migrations for you. With the `serverpod start` terminal focused:

- Pending migrations are applied automatically on the first boot.
- Press **A** to apply new migrations as you create them.

### In production or CI

To apply migrations explicitly, start the server runtime with the `--apply-migrations` flag from your `server` package directory. Migrations are applied as part of the startup sequence and the framework asserts that each migration is only applied once to the database.

```bash
$ dart run bin/main.dart --apply-migrations
Expand Down
Loading