Skip to content

Commit

Permalink
chore: restore realtime to postgres database
Browse files Browse the repository at this point in the history
  • Loading branch information
avallete committed Sep 27, 2024
1 parent 2822808 commit ccf214d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 0 additions & 5 deletions internal/db/start/templates/_supabase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ CREATE DATABASE _supabase WITH OWNER postgres;
-- Create schemas in _supabase database for
-- internals tools and reports to not overload user database
-- with non-user activity
CREATE SCHEMA IF NOT EXISTS _realtime;
ALTER SCHEMA _realtime OWNER TO postgres;
CREATE SCHEMA IF NOT EXISTS realtime;
ALTER SCHEMA realtime OWNER TO postgres;

CREATE SCHEMA IF NOT EXISTS _analytics;
ALTER SCHEMA _analytics OWNER TO postgres;

Expand Down
3 changes: 3 additions & 0 deletions internal/db/start/templates/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ALTER USER supabase_storage_admin WITH PASSWORD :'pgpass';
ALTER USER supabase_replication_admin WITH PASSWORD :'pgpass';
ALTER USER supabase_read_only_user WITH PASSWORD :'pgpass';

create schema if not exists _realtime;
alter schema _realtime owner to postgres;

BEGIN;

-- Create pg_net extension
Expand Down
2 changes: 1 addition & 1 deletion internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ EOF
fmt.Sprintf("DB_PORT=%d", dbConfig.Port),
"DB_USER=supabase_admin",
"DB_PASSWORD=" + dbConfig.Password,
"DB_NAME=_supabase",
"DB_NAME=" + dbConfig.Database,
"DB_AFTER_CONNECT_QUERY=SET search_path TO _realtime",
"DB_ENC_KEY=" + utils.Config.Realtime.EncryptionKey,
"API_JWT_SECRET=" + utils.Config.Auth.JwtSecret,
Expand Down

0 comments on commit ccf214d

Please sign in to comment.