Skip to content

Commit 8b7338f

Browse files
committed
Fix migration problems
1 parent ea5050b commit 8b7338f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,29 @@ jobs:
9999
psql -p 10563 -U dspace -d dspace -c \"
100100
DO \\\$\\\$
101101
BEGIN
102+
-- Create dspace5 role if it doesn't exist
102103
IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'dspace5') THEN
103104
CREATE ROLE dspace5;
104105
GRANT dspace5 TO dspace;
105106
ALTER ROLE dspace5 LOGIN;
106107
ALTER ROLE dspace5 INHERIT;
107108
END IF;
109+
110+
-- Create postgres role if it doesn't exist
111+
IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'postgres') THEN
112+
CREATE ROLE postgres;
113+
GRANT postgres TO dspace;
114+
ALTER ROLE postgres LOGIN;
115+
ALTER ROLE postgres INHERIT;
116+
ALTER ROLE postgres SUPERUSER;
117+
ALTER ROLE postgres CREATEDB;
118+
ALTER ROLE postgres CREATEROLE;
119+
END IF;
108120
END
109121
\\\$\\\$;
122+
123+
-- Create pgcrypto extension if it doesn't exist (required by DSpace)
124+
CREATE EXTENSION IF NOT EXISTS pgcrypto;
110125
\" &&
111126
psql -p 10563 -U dspace -d dspace -f /tmp/$FNAME &&
112127
rm /tmp/$FNAME

0 commit comments

Comments
 (0)