Skip to content

Commit 8231e3e

Browse files
committed
feat: adjust to only create for pg 15.x
1 parent 88d247e commit 8231e3e

File tree

5 files changed

+132
-2
lines changed

5 files changed

+132
-2
lines changed

migrations/db/init-scripts/00000000000000-initial-schema.sql

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ do $$
2222
begin
2323
if exists (select 1 from pg_available_extensions where name = 'pgjwt') then
2424
if not exists (select 1 from pg_extension where extname = 'pgjwt') then
25-
create extension if not exists pgjwt with schema "extensions" cascade;
25+
if current_setting('server_version_num')::int / 10000 = 15 then
26+
create extension if not exists pgjwt with schema "extensions" cascade;
27+
end if;
2628
end if;
2729
end if;
2830
end $$;

migrations/schema-15.sql

+42
Original file line numberDiff line numberDiff line change
@@ -1003,3 +1003,45 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
10031003
-- Dbmate schema migrations
10041004
--
10051005

1006+
INSERT INTO public.schema_migrations (version) VALUES
1007+
('00000000000000'),
1008+
('00000000000001'),
1009+
('00000000000002'),
1010+
('00000000000003'),
1011+
('10000000000000'),
1012+
('20211115181400'),
1013+
('20211118015519'),
1014+
('20211122051245'),
1015+
('20211124212715'),
1016+
('20211130151719'),
1017+
('20220118070449'),
1018+
('20220126121436'),
1019+
('20220224211803'),
1020+
('20220317095840'),
1021+
('20220321174452'),
1022+
('20220322085208'),
1023+
('20220404205710'),
1024+
('20220609081115'),
1025+
('20220613123923'),
1026+
('20220713082019'),
1027+
('20221028101028'),
1028+
('20221103090837'),
1029+
('20221207154255'),
1030+
('20230201083204'),
1031+
('20230224042246'),
1032+
('20230306081037'),
1033+
('20230327032006'),
1034+
('20230529180330'),
1035+
('20231013070755'),
1036+
('20231017062225'),
1037+
('20231020085357'),
1038+
('20231130133139'),
1039+
('20240124080435'),
1040+
('20240606060239'),
1041+
('20241031003909'),
1042+
('20241215003910'),
1043+
('20250205060043'),
1044+
('20250205144616'),
1045+
('20250218031949'),
1046+
('20250220051611'),
1047+
('20250312095419');

migrations/schema-17.sql

+42
Original file line numberDiff line numberDiff line change
@@ -990,3 +990,45 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
990990
-- Dbmate schema migrations
991991
--
992992

993+
INSERT INTO public.schema_migrations (version) VALUES
994+
('00000000000000'),
995+
('00000000000001'),
996+
('00000000000002'),
997+
('00000000000003'),
998+
('10000000000000'),
999+
('20211115181400'),
1000+
('20211118015519'),
1001+
('20211122051245'),
1002+
('20211124212715'),
1003+
('20211130151719'),
1004+
('20220118070449'),
1005+
('20220126121436'),
1006+
('20220224211803'),
1007+
('20220317095840'),
1008+
('20220321174452'),
1009+
('20220322085208'),
1010+
('20220404205710'),
1011+
('20220609081115'),
1012+
('20220613123923'),
1013+
('20220713082019'),
1014+
('20221028101028'),
1015+
('20221103090837'),
1016+
('20221207154255'),
1017+
('20230201083204'),
1018+
('20230224042246'),
1019+
('20230306081037'),
1020+
('20230327032006'),
1021+
('20230529180330'),
1022+
('20231013070755'),
1023+
('20231017062225'),
1024+
('20231020085357'),
1025+
('20231130133139'),
1026+
('20240124080435'),
1027+
('20240606060239'),
1028+
('20241031003909'),
1029+
('20241215003910'),
1030+
('20250205060043'),
1031+
('20250205144616'),
1032+
('20250218031949'),
1033+
('20250220051611'),
1034+
('20250312095419');

migrations/schema-orioledb-17.sql

+42
Original file line numberDiff line numberDiff line change
@@ -1004,3 +1004,45 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
10041004
-- Dbmate schema migrations
10051005
--
10061006

1007+
INSERT INTO public.schema_migrations (version) VALUES
1008+
('00000000000000'),
1009+
('00000000000001'),
1010+
('00000000000002'),
1011+
('00000000000003'),
1012+
('10000000000000'),
1013+
('20211115181400'),
1014+
('20211118015519'),
1015+
('20211122051245'),
1016+
('20211124212715'),
1017+
('20211130151719'),
1018+
('20220118070449'),
1019+
('20220126121436'),
1020+
('20220224211803'),
1021+
('20220317095840'),
1022+
('20220321174452'),
1023+
('20220322085208'),
1024+
('20220404205710'),
1025+
('20220609081115'),
1026+
('20220613123923'),
1027+
('20220713082019'),
1028+
('20221028101028'),
1029+
('20221103090837'),
1030+
('20221207154255'),
1031+
('20230201083204'),
1032+
('20230224042246'),
1033+
('20230306081037'),
1034+
('20230327032006'),
1035+
('20230529180330'),
1036+
('20231013070755'),
1037+
('20231017062225'),
1038+
('20231020085357'),
1039+
('20231130133139'),
1040+
('20240124080435'),
1041+
('20240606060239'),
1042+
('20241031003909'),
1043+
('20241215003910'),
1044+
('20250205060043'),
1045+
('20250205144616'),
1046+
('20250218031949'),
1047+
('20250220051611'),
1048+
('20250312095419');

nix/tests/prime.sql

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ do $$
6161
begin
6262
if exists (select 1 from pg_available_extensions where name = 'pgjwt') then
6363
if not exists (select 1 from pg_extension where extname = 'pgjwt') then
64-
create extension if not exists pgjwt;
64+
if current_setting('server_version_num')::int / 10000 = 15 then
65+
create extension if not exists pgjwt;
66+
end if;
6567
end if;
6668
end if;
6769
end $$;

0 commit comments

Comments
 (0)