Skip to content

Commit 44df10e

Browse files
authoredFeb 27, 2025
move orioledb to extensions schema (#1448)
* chore: move orioledb to extensions scehama * ore: update schemas * chore: create testing AMI images * chore: bump version for release This change targets orioledb moving installed orioledb extension from "public" schema to "extensions" schema
1 parent 084b914 commit 44df10e

File tree

5 files changed

+89
-60
lines changed

5 files changed

+89
-60
lines changed
 

‎ansible/vars.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ postgres_major:
88

99
# Full version strings for each major version
1010
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"
1313

1414
# Non Postgres Extensions
1515
pgbouncer_release: "1.19.0"

‎migrations/README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,18 @@ Additionally, [supabase/postgres](https://github.com/supabase/postgres/blob/deve
7878

7979
### Add a Migration
8080

81+
First, start a local postgres server and apply the migrations
82+
8183
```shell
8284
# Start the database server
83-
docker-compose up
85+
nix run .#dbmate-tool -- --version 15 --flake-url "."
8486

8587
# create a new migration
88+
nix develop
8689
dbmate new '<some message>'
8790
```
8891

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
9093

9194
```shell
9295
dbmate up
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+

‎migrations/schema-orioledb-17.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ CREATE SCHEMA vault;
9191
-- Name: orioledb; Type: EXTENSION; Schema: -; Owner: -
9292
--
9393

94-
CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA public;
94+
CREATE EXTENSION IF NOT EXISTS orioledb WITH SCHEMA extensions;
9595

9696

9797
--

0 commit comments

Comments
 (0)
Failed to load comments.