added sqitch and first table

This commit is contained in:
Andrei Stoica 2024-01-24 23:13:31 -05:00
parent b6ff046116
commit 0db1ffd667
9 changed files with 68 additions and 0 deletions

1
.aliases Normal file
View File

@ -0,0 +1 @@
alias sqitchl='SQITCH_PASSWORD=$POSTGRES_PASSWORD sqitch -u $POSTGRES_USER -p $POSTGRES_PORT -h 127.0.0.1'

8
sqitch.conf Normal file
View File

@ -0,0 +1,8 @@
[core]
engine = pg
top_dir = sqitch
# plan_file = sqitch/sqitch.plan
# [engine "pg"]
# target = db:pg:
# registry = sqitch
# client = psql

View File

@ -0,0 +1,7 @@
-- Deploy leetify-data:data-schema to pg
BEGIN;
CREATE SCHEMA data;
COMMIT;

View File

@ -0,0 +1,15 @@
-- Deploy leetify-data:profile-meta to pg
-- requires: data-schema
BEGIN;
CREATE TABLE IF NOT EXISTS data.profile_meta (
steam64Id TEXT,
isCollector BOOL,
isLeetifyStaff BOOL,
isProPlan BOOL,
leetifyUserId TEXT,
faceitNickname TEXT
);
COMMIT;

View File

@ -0,0 +1,7 @@
-- Revert leetify-data:data-schema from pg
BEGIN;
DROP SCHEMA data;
COMMIT;

View File

@ -0,0 +1,8 @@
-- Revert leetify-data:profile-meta from pg
BEGIN;
DROP TABLE data.profile_meta;
COMMIT;

5
sqitch/sqitch.plan Normal file
View File

@ -0,0 +1,5 @@
%syntax-version=1.0.0
%project=leetify-data
data-schema 2024-01-25T03:19:31Z andrei <andrei@tower> # adding schema for data
profile-meta [data-schema] 2024-01-25T03:28:08Z andrei <andrei@tower> # add table for profile metadata

View File

@ -0,0 +1,7 @@
-- Verify leetify-data:data-schema on pg
BEGIN;
SELECT pg_catalog.has_schema_privilege('data', 'usage');
ROLLBACK;

View File

@ -0,0 +1,10 @@
-- Verify leetify-data:profile-meta on pg
BEGIN;
SELECT steam64Id, isCollector, isLeetifyStaff,
isProPlan, leetifyUserId, faceitNickname
FROM data.profile_meta
WHERE FALSE;
ROLLBACK;