refactor to db setup for admin-cli

This commit is contained in:
shockrah 2024-11-11 19:33:54 -08:00
parent 747442799d
commit 5b48288179
4 changed files with 22 additions and 0 deletions

2
db/setup-db.sql Normal file
View File

@ -0,0 +1,2 @@
DROP DATABASE IF EXISTS bubble;
CREATE DATABASE bubble;

8
db/setup-user.sql Normal file
View File

@ -0,0 +1,8 @@
-- Create the user that we'll use for service data
DO $SERVICE_USER_CREATION$
BEGIN
CREATE ROLE bubble_api;
EXCEPTION WHEN duplicate_object THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE;
END
$SERVICE_USER_CREATION$;

12
db/setup.sql Normal file
View File

@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS users (
id INTEGER,
name VARCHAR(256),
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS invites (
id BIGINT,
expires INTEGER,
PRIMARY KEY (id)
);