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
* feat: basic running of dbmate migrations from tool
* feat: a nix flake app tool to run dbmate migrations and produce
schema.slq files
* feat: test against schema.sql per mjr vrs + tool to generate
* chore: pin at development branch version of tool
* docs: update docs with usage info
* fix: tmp use this working branch for flakeurl
* chore: cleanup of test and dbmage migration tool
* chore: build this version
* chore: extra-conf
* chore: reinstall true
* chore: test no longer needs self-hosted runner, can use ephemeral
* chore: correct format of runner
* chore: not longer need sudo
* chore: trying to get the action to use our cache
* chore: conf 2nd invocation
* chore: rm var
* chore: nl
* chore: cleanup and remove unnecessary changes
* fix: make sure to run sql for pg-stat-extensions and pg-bouncer
Copy file name to clipboardExpand all lines: migrations/README.md
+38-1Lines changed: 38 additions & 1 deletion
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:
@@ -20,10 +55,12 @@ For compatibility with hosted projects, we include [migrate.sh](migrate.sh) that
20
55
21
56
1. Run all `db/init-scripts` with `postgres` superuser role.
22
57
2. Run all `db/migrations` with `supabase_admin` superuser role.
23
-
3. Finalize role passwords with `/etc/postgres.schema.sql` if present.
58
+
3. Finalize role passwords with `/etc/postgresql.schema.sql` if present.
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