The basic workflow is as follows:
seagull init
```
```
creates a seagull.toml
file for storing connection strings and other config values. This file is optional, you can use the other commands without it.
firstly creates a directory named migrations
if one does not already exist. Secondly creates an empty .sql
file in the format V{1}__{2}.sql
where {1}
is an auto-incremented version number and {2}
is a description.
```bash USAGE
$ seagull poop initial
$ seagull poop "create users table"
$ seagull poop another_migration ```
firstly creates a database table named __migration_history
if one does not already exist. Runs all migrations in the migrations
directory in a single transaction. If one fails, they all fail and the database is rolled back.
```bash USAGE
$ seagull migrate
$ seagull migrate --database postgresql://postgres:mysecretpassword@localhost/postgres
$ seagull migrate --dir src/migrations ```
Same as seagull migrate
except that it will firstly reset the whole database before running all migrations. Useful for development if you're using a Docker database and changing migrations often. Would NOT suggest running it on production! :skullandcrossbones:
```bash
$ seagull remigrate
$ seagull remigrate --database postgresql://postgres:mysecretpassword@localhost/postgres
$ seagull remigrate --dir src/migrations ```