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