You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: migrations/README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
+
```
1
34
# supabase/migrations
2
35
3
36
`supabase/migrations` is a consolidation of SQL migrations from:
@@ -9,6 +42,8 @@
9
42
10
43
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)
11
44
45
+
46
+
12
47
## How it was Created
13
48
14
49
Migrations were pulled (in order) from:
@@ -24,6 +59,8 @@ For compatibility with hosted projects, we include [migrate.sh](migrate.sh) that
24
59
25
60
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.
26
61
62
+
63
+
27
64
## Guidelines
28
65
29
66
- Migrations are append only. Never edit existing migrations once they are on master.
0 commit comments