Working db setup with admin-cli

This commit is contained in:
2024-11-24 15:38:25 -08:00
parent 7230c2d015
commit df978d7250
5 changed files with 111 additions and 64 deletions

View File

@@ -1,8 +1,9 @@
-- Create the user that we'll use for service data
DO $SERVICE_USER_CREATION$
-- TODO: IDK wtf is wrong with this statement but im forgoing making this
-- work for the time being
$$
BEGIN
CREATE ROLE bubble_admin WITH PASSWORD $1;
EXCEPTION WHEN duplicate_object THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE;
IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'bubble_admin') THEN
CREATE USER 'bubble_admin' WITH PASSWORD $1;
END IF
END
$SERVICE_USER_CREATION$;
$$