Skip to content

Commit f174eee

Browse files
committed
docs: update docs with usage info
1 parent 8e2ef5a commit f174eee

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

migrations/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
# Usage
2+
3+
from the root of the `supabase/postgres` project, you can run the following commands:
4+
5+
6+
```shell
7+
Usage: nix run .#dbmate-tool -- [options]
8+
9+
Options:
10+
-v, --version [15|16|orioledb-17|all] Specify the PostgreSQL version to use (required defaults to --version all)
11+
-p, --port PORT Specify the port number to use (default: 5435)
12+
-h, --help Show this help message
13+
14+
Description:
15+
Runs 'dbmate up' against a locally running the version of database you specify. Or 'all' to run against all versions.
16+
NOTE: To create a migration, you must run 'nix develop' and then 'dbmate new <migration_name>' to create a new migration file.
17+
18+
Examples:
19+
nix run .#dbmate-tool
20+
nix run .#dbmate-tool -- --version 15
21+
nix run .#dbmate-tool -- --version 16 --port 5433
22+
23+
```
24+
25+
This can also be run from a github "flake url" for example:
26+
27+
```shell
28+
nix run github:supabase/postgres#dbmate-tool -- --version 15
29+
30+
or
31+
32+
nix run github:supabase/postgres/mybranch#dbmate-tool -- --version 15
33+
```
134
# supabase/migrations
235

336
`supabase/migrations` is a consolidation of SQL migrations from:
@@ -9,6 +42,8 @@
942

1043
aiming to provide a single source of truth for migrations on the platform that can be depended upon by those components. For more information on goals see [the RFC](https://www.notion.so/supabase/Centralize-SQL-Migrations-cd3847ae027d4f2bba9defb2cc82f69a)
1144

45+
46+
1247
## How it was Created
1348

1449
Migrations were pulled (in order) from:
@@ -24,6 +59,8 @@ For compatibility with hosted projects, we include [migrate.sh](migrate.sh) that
2459

2560
Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/develop/ansible/playbook-docker.yml#L9) image contains several migration scripts to configure default extensions. These are run first by docker entrypoint and included in ami by ansible.
2661

62+
63+
2764
## Guidelines
2865

2966
- Migrations are append only. Never edit existing migrations once they are on master.

0 commit comments

Comments
 (0)