File tree Expand file tree Collapse file tree 6 files changed +56
-5
lines changed
Expand file tree Collapse file tree 6 files changed +56
-5
lines changed Original file line number Diff line number Diff line change 1- # Builder docker image.
2- FROM postgis/postgis:12 -3.1
1+ # base Docker image
2+ FROM postgis/postgis:15 -3.5
33
44# fix collations to use fi_FI
55RUN localedef -i fi_FI -c -f UTF-8 -A /usr/share/locale/locale.alias fi_FI.UTF-8
Original file line number Diff line number Diff line change 1+ -- Make the JORE4 admin user the owner of the public schema.
2+ ALTER SCHEMA public OWNER TO CURRENT_USER ;
3+
14-- Create the extensions used, see https://hasura.io/docs/latest/graphql/core/deployment/postgres-requirements.html
25-- Create the extensions in the public schema, since we'd need to give additional privileges ("use schema") to any
36-- user who wishes to use these in the future. Also, Hasura would require additional setup to be able to use the
@@ -8,3 +11,13 @@ CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
811
912-- Allow Hasura to create new schemas.
1013GRANT CREATE ON DATABASE xxx_db_hasura_name_xxx TO xxx_db_hasura_username_xxx;
14+
15+ -- Grant select permissions on information_schema and pg_catalog to the Hasura
16+ -- user.
17+ GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO xxx_db_hasura_username_xxx;
18+ GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO xxx_db_hasura_username_xxx;
19+
20+ -- Grant required privileges in the public schema to the Hasura user.
21+ GRANT ALL ON SCHEMA public TO xxx_db_hasura_username_xxx;
22+ GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx_db_hasura_username_xxx;
23+ GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO xxx_db_hasura_username_xxx;
Original file line number Diff line number Diff line change 1- -- Create database and give ALL privileges to the auth user .
1+ -- Create database and allow the auth user to create new schemas in it .
22CREATE DATABASE xxx_db_auth_name_xxx ;
33GRANT ALL ON DATABASE xxx_db_auth_name_xxx TO xxx_db_auth_username_xxx;
4+
5+ \connect xxx_db_auth_name_xxx;
6+
7+ -- Make the JORE4 admin user the owner of the public schema.
8+ ALTER SCHEMA public OWNER TO CURRENT_USER ;
9+
10+ -- Grant full schema access to the public schema to the auth user.
11+ GRANT ALL ON SCHEMA public TO xxx_db_auth_username_xxx;
Original file line number Diff line number Diff line change 1- -- Create database and give ALL privileges to the jore3importer user .
1+ -- Create database and allow the jore3importer user to create new schemas in it .
22CREATE DATABASE xxx_db_jore3importer_name_xxx ;
33GRANT ALL ON DATABASE xxx_db_jore3importer_name_xxx TO xxx_db_jore3importer_username_xxx;
4+
5+ \connect xxx_db_jore3importer_name_xxx;
6+
7+ -- Make the JORE4 admin user the owner of the public schema.
8+ ALTER SCHEMA public OWNER TO CURRENT_USER ;
9+
10+ -- Grant privileges in the public schema to the jore3importer user.
11+ GRANT USAGE ON SCHEMA public TO xxx_db_jore3importer_username_xxx;
12+ GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx_db_jore3importer_username_xxx;
13+ GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO xxx_db_jore3importer_username_xxx;
Original file line number Diff line number Diff line change @@ -9,5 +9,17 @@ ALTER DATABASE xxx_db_timetables_name_xxx SET intervalstyle = 'iso_8601';
99-- Switch database context to be able to add extensions there.
1010\connect xxx_db_timetables_name_xxx;
1111
12+ -- Make the JORE4 admin user the owner of the public schema.
13+ ALTER SCHEMA public OWNER TO CURRENT_USER ;
14+
1215CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
1316CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
17+
18+ -- Grant select permissions on information_schema and pg_catalog to Hasura.
19+ GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO xxx_db_hasura_username_xxx;
20+ GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO xxx_db_hasura_username_xxx;
21+
22+ -- Grant required privileges in the public schema to Hasura.
23+ GRANT ALL ON SCHEMA public TO xxx_db_hasura_username_xxx;
24+ GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx_db_hasura_username_xxx;
25+ GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO xxx_db_hasura_username_xxx;
Original file line number Diff line number Diff line change 1- -- Create database and give ALL privileges to Tiamat in it.
1+ -- Create database and allow Tiamat to create new schemas in it.
22CREATE DATABASE xxx_db_tiamat_name_xxx ;
33GRANT ALL ON DATABASE xxx_db_tiamat_name_xxx TO xxx_db_tiamat_username_xxx;
44
55-- Switch database context to initialise it to the state where Tiamat can use
66-- it.
77\connect xxx_db_tiamat_name_xxx;
88
9+ -- Make the JORE4 admin user the owner of the public schema.
10+ ALTER SCHEMA public OWNER TO CURRENT_USER ;
11+
912CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
1013CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
1114
15+ -- Grant required privileges in the public schema to Tiamat.
16+ GRANT ALL ON SCHEMA public TO xxx_db_tiamat_username_xxx;
17+ GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx_db_tiamat_username_xxx;
18+ GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO xxx_db_tiamat_username_xxx;
19+
1220CREATE SCHEMA IF NOT EXISTS topology AUTHORIZATION xxx_db_tiamat_username_xxx;
1321CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology;
1422-- The postgis_topology creates two tables.
You can’t perform that action at this time.
0 commit comments