From 830301f4918ca5c5d052227c85a45c6808a03c39 Mon Sep 17 00:00:00 2001 From: c0repwn3r Date: Wed, 1 Mar 2023 10:09:59 -0500 Subject: [PATCH] [mig/maintainability] add some detail comments to migration files --- trifid-api/migrations/20230204174853_create_users.sql | 6 +++--- trifid-api/migrations/20230204185754_magic_links.sql | 2 +- .../migrations/20230206012409_create_session_tokens.sql | 2 +- trifid-api/migrations/20230207145453_create_totp_tokens.sql | 2 +- trifid-api/migrations/20230224000741_create_orgs.sql | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/trifid-api/migrations/20230204174853_create_users.sql b/trifid-api/migrations/20230204174853_create_users.sql index eaeb63a..53fce23 100644 --- a/trifid-api/migrations/20230204174853_create_users.sql +++ b/trifid-api/migrations/20230204174853_create_users.sql @@ -17,10 +17,10 @@ CREATE TABLE users ( id SERIAL NOT NULL PRIMARY KEY, email VARCHAR(320) NOT NULL UNIQUE, - created_on INTEGER NOT NULL, + created_on INTEGER NOT NULL, -- Unix (seconds) timestamp of user creation - banned INTEGER NOT NULL, - ban_reason VARCHAR(1024) NOT NULL, + banned INTEGER NOT NULL, -- Is the user banned? 1=Yes 0=No + ban_reason VARCHAR(1024) NOT NULL, -- What is the reason for this user's ban? totp_secret VARCHAR(128) NOT NULL, totp_verified INTEGER NOT NULL, diff --git a/trifid-api/migrations/20230204185754_magic_links.sql b/trifid-api/migrations/20230204185754_magic_links.sql index 3208b12..889ddb2 100644 --- a/trifid-api/migrations/20230204185754_magic_links.sql +++ b/trifid-api/migrations/20230204185754_magic_links.sql @@ -17,5 +17,5 @@ CREATE TABLE magic_links ( id VARCHAR(39) NOT NULL PRIMARY KEY UNIQUE, user_id SERIAL NOT NULL REFERENCES users(id), - expires_on INTEGER NOT NULL + expires_on INTEGER NOT NULL -- Unix (seconds) timestamp of when this link expires ); \ No newline at end of file diff --git a/trifid-api/migrations/20230206012409_create_session_tokens.sql b/trifid-api/migrations/20230206012409_create_session_tokens.sql index 87a6c06..e7d0133 100644 --- a/trifid-api/migrations/20230206012409_create_session_tokens.sql +++ b/trifid-api/migrations/20230206012409_create_session_tokens.sql @@ -17,5 +17,5 @@ CREATE TABLE session_tokens ( id VARCHAR(39) NOT NULL PRIMARY KEY, user_id SERIAL NOT NULL REFERENCES users(id), - expires_on INTEGER NOT NULL + expires_on INTEGER NOT NULL -- Unix (seconds) timestamp of when this session expires ); \ No newline at end of file diff --git a/trifid-api/migrations/20230207145453_create_totp_tokens.sql b/trifid-api/migrations/20230207145453_create_totp_tokens.sql index 1f08efe..86b493c 100644 --- a/trifid-api/migrations/20230207145453_create_totp_tokens.sql +++ b/trifid-api/migrations/20230207145453_create_totp_tokens.sql @@ -16,7 +16,7 @@ CREATE TABLE totp_create_tokens ( id VARCHAR(41) NOT NULL PRIMARY KEY, - expires_on INTEGER NOT NULL, + expires_on INTEGER NOT NULL, -- The unix (seconds) timestamp of when this TOTP create token expires totp_otpurl VARCHAR(3000) NOT NULL, totp_secret VARCHAR(128) NOT NULL ); \ No newline at end of file diff --git a/trifid-api/migrations/20230224000741_create_orgs.sql b/trifid-api/migrations/20230224000741_create_orgs.sql index 66e5807..5a50f13 100644 --- a/trifid-api/migrations/20230224000741_create_orgs.sql +++ b/trifid-api/migrations/20230224000741_create_orgs.sql @@ -17,8 +17,8 @@ CREATE TABLE organizations ( id SERIAL NOT NULL PRIMARY KEY, owner SERIAL NOT NULL REFERENCES users(id), - ca_key VARCHAR(3072) NOT NULL, - ca_crt VARCHAR(3072) NOT NULL, - iv VARCHAR(128) NOT NULL + ca_key VARCHAR(3072) NOT NULL, -- The hex-encoded ENCRYPTED (see below) concatenation of all CA keys on this org + ca_crt VARCHAR(3072) NOT NULL, -- The concatenation of all CA certificates on this org. This is passed directly to NebulaCAPool + iv VARCHAR(128) NOT NULL -- The 12-byte hex-encoded IV, used to encrypt ca_key with the instance AES key ); CREATE INDEX idx_organizations_owner ON organizations(owner); \ No newline at end of file