summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-26 11:35:56 +0200
committerKyren223 <Kyren223@proton.me>2024-11-26 11:35:56 +0200
commit49ea3d630ba72a68cd55d9bdb2d9af30b062c6a4 (patch)
tree923e124d187988e7cb2f2a071bbd071405267425
parent3cea06b99197778c80226de40b2acae734422834 (diff)
Network table schema bg_hex_color cannot be null
-rw-r--r--migrations/20241026174345_init.sql2
-rw-r--r--query/networks.sql3
2 files changed, 3 insertions, 2 deletions
diff --git a/migrations/20241026174345_init.sql b/migrations/20241026174345_init.sql
index 366d338..d20898a 100644
--- a/migrations/20241026174345_init.sql
+++ b/migrations/20241026174345_init.sql
@@ -28,7 +28,7 @@ CREATE TABLE networks (
owner_id INT NOT NULL REFERENCES users (id),
name TEXT NOT NULL,
icon TEXT NOT NULL,
- bg_hex_color TEXT,
+ bg_hex_color TEXT NOT NULL,
fg_hex_color TEXT NOT NULL,
is_public BOOLEAN NOT NULL CHECK (is_public IN (0, 1))
);
diff --git a/query/networks.sql b/query/networks.sql
index 7a6ccc4..9ff350e 100644
--- a/query/networks.sql
+++ b/query/networks.sql
@@ -11,7 +11,8 @@ INSERT INTO networks (
id, owner_id, name, is_public,
icon, bg_hex_color, fg_hex_color
) VALUES (
- ?, ?, ?, ?, ?, ?, ?
+ ?, ?, ?, ?,
+ ?, ?, ?
)
RETURNING *;