5 files changed +89
-60
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ postgres_major:
8
8
9
9
# Full version strings for each major version
10
10
postgres_release :
11
- postgresorioledb-17 : " 17.0.1.039 -orioledb"
12
- postgres15 : " 15.8.1.045 "
11
+ postgresorioledb-17 : " 17.0.1.040 -orioledb"
12
+ postgres15 : " 15.8.1.046 "
13
13
14
14
# Non Postgres Extensions
15
15
pgbouncer_release : " 1.19.0"
Original file line number Diff line number Diff line change @@ -78,15 +78,18 @@ Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/deve
78
78
79
79
### Add a Migration
80
80
81
+ First, start a local postgres server and apply the migrations
82
+
81
83
``` shell
82
84
# Start the database server
83
- docker-compose up
85
+ nix run . # dbmate-tool -- --version 15 --flake-url "."
84
86
85
87
# create a new migration
88
+ nix develop
86
89
dbmate new ' <some message>'
87
90
```
88
91
89
- Then, populate the migration at ` ./db/migrations/xxxxxxxxx_<some_message> ` and make sure it execute sucessfully with
92
+ Then, execute the migration at ` ./db/migrations/xxxxxxxxx_<some_message> ` and make sure it runs sucessfully with
90
93
91
94
``` shell
92
95
dbmate up
Original file line number Diff line number Diff line change
1
+ -- migrate:up
2
+ do $$
3
+ declare
4
+ ext_schema text ;
5
+ extensions_schema_exists boolean ;
6
+ begin
7
+ -- check if the "extensions" schema exists
8
+ select exists (
9
+ select 1 from pg_namespace where nspname = ' extensions'
10
+ ) into extensions_schema_exists;
11
+
12
+ if extensions_schema_exists then
13
+ -- check if the "orioledb" extension is in the "public" schema
14
+ select nspname into ext_schema
15
+ from pg_extension e
16
+ join pg_namespace n on e .extnamespace = n .oid
17
+ where extname = ' orioledb' ;
18
+
19
+ if ext_schema = ' public' then
20
+ execute ' alter extension orioledb set schema extensions' ;
21
+ end if;
22
+ end if;
23
+ end $$;
24
+
25
+ -- migrate:down
26
+
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ CREATE SCHEMA vault;
91
91
-- Name: orioledb; Type: EXTENSION; Schema: -; Owner: -
92
92
--
93
93
94
- CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA public ;
94
+ CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA extensions ;
95
95
96
96
97
97
--
0 commit comments