From 5b6778337a7c63dcc8e148c8f748a5f47bb53fe9 Mon Sep 17 00:00:00 2001 From: core Date: Thu, 2 Feb 2023 21:53:11 -0500 Subject: [PATCH] db stuff --- trifid-api/migrations/20230203003134_create_orgs.sql | 7 ++++++- trifid-api/migrations/20230203025121_create_users.sql | 5 +++++ trifid-api/migrations/20230203025138_create_roles.sql | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 trifid-api/migrations/20230203025121_create_users.sql create mode 100644 trifid-api/migrations/20230203025138_create_roles.sql diff --git a/trifid-api/migrations/20230203003134_create_orgs.sql b/trifid-api/migrations/20230203003134_create_orgs.sql index 8ddc1d3..9102aa6 100644 --- a/trifid-api/migrations/20230203003134_create_orgs.sql +++ b/trifid-api/migrations/20230203003134_create_orgs.sql @@ -1 +1,6 @@ --- Add migration script here +CREATE TABLE organizations ( + id SERIAL NOT NULL PRIMARY KEY, + network_range VARCHAR(18) NOT NULL, -- https://docs.defined.net/guides/choosing-a-cidr/ + org_name VARCHAR(258) NOT NULL +); +CREATE INDEX idx_organizations_name ON organizations(org_name); \ No newline at end of file diff --git a/trifid-api/migrations/20230203025121_create_users.sql b/trifid-api/migrations/20230203025121_create_users.sql new file mode 100644 index 0000000..dc48343 --- /dev/null +++ b/trifid-api/migrations/20230203025121_create_users.sql @@ -0,0 +1,5 @@ +CREATE TABLE users ( + id SERIAL NOT NULL PRIMARY KEY, + email VARCHAR(320) NOT NULL, + totp_secret VARCHAR(512) NOT NULL +) \ No newline at end of file diff --git a/trifid-api/migrations/20230203025138_create_roles.sql b/trifid-api/migrations/20230203025138_create_roles.sql new file mode 100644 index 0000000..8ddc1d3 --- /dev/null +++ b/trifid-api/migrations/20230203025138_create_roles.sql @@ -0,0 +1 @@ +-- Add migration script here