aboutsummaryrefslogtreecommitdiff
path: root/migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql')
-rw-r--r--migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql b/migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql
new file mode 100644
index 00000000..8d495e72
--- /dev/null
+++ b/migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql
@@ -0,0 +1,19 @@
+CREATE TABLE auth_requests (
+ uuid CHAR(36) NOT NULL PRIMARY KEY,
+ user_uuid CHAR(36) NOT NULL,
+ organization_uuid CHAR(36),
+ request_device_identifier CHAR(36) NOT NULL,
+ device_type INTEGER NOT NULL,
+ request_ip TEXT NOT NULL,
+ response_device_id CHAR(36),
+ access_code TEXT NOT NULL,
+ public_key TEXT NOT NULL,
+ enc_key TEXT NOT NULL,
+ master_password_hash TEXT NOT NULL,
+ approved BOOLEAN,
+ creation_date TIMESTAMP NOT NULL,
+ response_date TIMESTAMP,
+ authentication_date TIMESTAMP,
+ FOREIGN KEY(user_uuid) REFERENCES users(uuid),
+ FOREIGN KEY(organization_uuid) REFERENCES organizations(uuid)
+); \ No newline at end of file