fix(ci): correct the CI role grants - apply them in coreci_ci and FOR ROLE migrator (the app role had no table grants)
ci / test-pglite (PGlite, default) (push) Failing after 1m51s
ci / test-postgres (Postgres 16, G-022 RLS) (push) Failing after 1m12s
ci / test-pglite (PGlite, default) (pull_request) Failing after 1m49s
ci / test-postgres (Postgres 16, G-022 RLS) (pull_request) Failing after 1m11s
ci / test-pglite (PGlite, default) (push) Failing after 1m51s
ci / test-postgres (Postgres 16, G-022 RLS) (push) Failing after 1m12s
ci / test-pglite (PGlite, default) (pull_request) Failing after 1m49s
ci / test-postgres (Postgres 16, G-022 RLS) (pull_request) Failing after 1m11s
This commit is contained in:
@@ -41,7 +41,8 @@ END $$;
|
||||
-- the migrations and the test run happen in `coreci_ci`). The grants below are
|
||||
-- per-database, so they have to be applied in the database the tests use.
|
||||
SELECT 'CREATE DATABASE coreci_ci OWNER migrator'
|
||||
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'coreci_ci')\gexec-- Switch to that database. The script connects to `postgres` first (the roles
|
||||
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'coreci_ci')\gexec
|
||||
-- Switch to that database. The script connects to `postgres` first (the roles
|
||||
-- are cluster-level and the database does not exist yet); schema and table
|
||||
-- privileges granted in `postgres` do not reach the tables in `coreci_ci`.
|
||||
\connect coreci_ci
|
||||
@@ -75,6 +76,5 @@ BEGIN
|
||||
END LOOP;
|
||||
END $$;
|
||||
|
||||
-- Create the CI database (the service container's default is `postgres`;
|
||||
-- the CI workflow creates a separate `coreci_ci` database for the test run).
|
||||
-- This is optional — the workflow may set DATABASE_URL to point at any DB.
|
||||
SELECT 'CREATE DATABASE coreci_ci OWNER migrator'
|
||||
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'coreci_ci')\gexec
|
||||
|
||||
Reference in New Issue
Block a user