diff --git a/db/setup-db.sql b/db/setup-db.sql new file mode 100644 index 0000000..96139fc --- /dev/null +++ b/db/setup-db.sql @@ -0,0 +1,2 @@ +DROP DATABASE IF EXISTS bubble; +CREATE DATABASE bubble; diff --git a/db/tables.sql b/db/setup-tables.sql similarity index 100% rename from db/tables.sql rename to db/setup-tables.sql diff --git a/db/setup-user.sql b/db/setup-user.sql new file mode 100644 index 0000000..01c4649 --- /dev/null +++ b/db/setup-user.sql @@ -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$; + diff --git a/db/setup.sql b/db/setup.sql new file mode 100644 index 0000000..338c52a --- /dev/null +++ b/db/setup.sql @@ -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) +);