Skip to content
Snippets Groups Projects
Commit 29b826ff authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

try fix error database creation if exists

parent 33e14c34
No related branches found
No related tags found
No related merge requests found
Pipeline #154559 passed
......@@ -46,6 +46,7 @@ spec:
cp /custom-init-scripts/99-roles.sql /initdb.d/init-scripts/99-roles.sql
# Initialize the database settings with JWT_SECRET and JWT_EXP
cp /custom-init-scripts/99-jwt.sql /initdb.d/init-scripts/99-jwt.sql
# should not execute this script since it is already in the image
cp /custom-init-scripts/97-_supabase.sql /initdb.d/migrations/97-_supabase.sql
cp /custom-init-scripts/99-logs.sql /initdb.d/migrations/99-logs.sql
cp /custom-init-scripts/99-pooler.sql /initdb.d/migrations/99-pooler.sql
......
......@@ -257,8 +257,17 @@ data:
97-_supabase.sql: |
\set pguser `echo "$POSTGRES_USER"`
CREATE DATABASE _supabase WITH OWNER :pguser;
DO $$
BEGIN
IF NOT EXISTS (
SELECT FROM pg_database
WHERE datname = '_supabase'
) THEN
EXECUTE 'CREATE DATABASE _supabase';
END IF;
END
$$;
ALTER DATABASE _supabase WITH OWNER :pguser;
......
......@@ -186,7 +186,6 @@ data:
method: 'post'
request:
retry_max_duration_secs: 10
encoding:
uri: 'http://{{ include "supabase.analytics.fullname" . }}:{{ .Values.analytics.service.port }}/api/logs?source_name=gotrue.logs.prod&api_key=SECRET[credentials.logflare_api_key]'
logflare_realtime:
type: 'http'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment