summaryrefslogtreecommitdiff
path: root/internal/server/api/migrations/20250109134844_users.sql
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-01-09 17:28:46 +0200
committerKyren223 <Kyren223@proton.me>2025-01-09 17:28:46 +0200
commit936d3cf690ace9adfdfe0fb44193c11a0cb26d95 (patch)
tree3d0699aa5c50efb7ecac3dddd25fe959366b7562 /internal/server/api/migrations/20250109134844_users.sql
parentd0cb135161b18f37c25501cb863fa783cd723758 (diff)
Added goose for migrations, refactored SQL schema, server and client
are broken
Diffstat (limited to 'internal/server/api/migrations/20250109134844_users.sql')
-rw-r--r--internal/server/api/migrations/20250109134844_users.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/server/api/migrations/20250109134844_users.sql b/internal/server/api/migrations/20250109134844_users.sql
new file mode 100644
index 0000000..8ebb9eb
--- /dev/null
+++ b/internal/server/api/migrations/20250109134844_users.sql
@@ -0,0 +1,12 @@
+-- +goose Up
+CREATE TABLE IF NOT EXISTS users (
+ id INTEGER PRIMARY KEY,
+ name TEXT NOT NULL,
+ public_key BLOB NOT NULL UNIQUE,
+ description TEXT NOT NULL DEFAULT '',
+ is_public_dm BOOLEAN NOT NULL CHECK (is_public_dm IN (false, true)) DEFAULT true,
+ is_deleted BOOLEAN NOT NULL CHECK (is_deleted IN (false, true)) DEFAULT false
+);
+
+-- +goose Down
+DROP TABLE IF EXISTS users;