Skip to content

Commit 70b1181

Browse files
docs: schema.sql per maj version update (#1555)
* Update migrations/README.md Co-authored-by: Steve Chavez <[email protected]> * chore: more info on generation of schema.sql and running tests * chore: fix typo --------- Co-authored-by: Steve Chavez <[email protected]>
1 parent db4b292 commit 70b1181

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

migrations/README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,22 @@ After making changes to migrations, you should update the schema.sql files for e
134134
nix run .#dbmate-tool -- --version all
135135
```
136136

137-
This will create a schema.sql file for each major version of PostgreSQL. Commit these changes to your repository and push to your branch. The test.yml workflow will verify these changes against the test matrix.
137+
This will create automatically schema.sql file for each major version of PostgreSQL and OrioleDB (the files are named like `schema-<ver>`, `schema-oriole-<ver>`). Commit these changes to your repository and push to your branch. The workflow in `.github/workflows/test.yml` will re-run this command in CI, and perform a git diff to verify the idempotency of the migrations, and that the latest changes have been committed.
138+
138139
## Testing
139140

140-
Migrations are tested in CI to ensure they do not raise an exception against previously released `supabase/postgres` docker images. The full version matrix is at [test.yml](./.github/workflows/test.yml) in the `supabase-version` variable.
141+
In addition to ci test mentioned above, you can test migrations locally by running the following test for each major version of postgres one at a time.
142+
143+
Examples:
144+
145+
```
146+
nix build .#checks.aarch64-darwin.psql_15 -L
147+
nix build .#checks.aarch64-darwin.psql_17 -L
148+
nix build .#checks.aarch64-darwin.psql_orioledb-17 -L
149+
```
150+
151+
(Note that the evaluation and nix build of the postgres packages "bundle" of each major version must succeed here, even though we run one version at a time. If you made changes to postgres or extensions, or wrappers those may rebuild here when you run this. Otherwise they will usually download the prebuilt version from the supabase nix binary cache)
152+
153+
At the end of these commands, you will see the output of both `pg_regress` tests, and migration tests
154+
155+
see [Adding Tests](https://github.com/supabase/postgres/blob/develop/nix/docs/adding-tests.md) for more information.

0 commit comments

Comments
 (0)