commit 6a28264115bafd7eadb58fa063af1c6a3301961e
parent 94c8af5b824e81533363763955f2208252bfdb67
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Thu, 3 Aug 2023 15:32:41 +0200
edits
Diffstat:
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/database-versioning/nexus-0001.sql b/database-versioning/nexus-0001.sql
@@ -20,18 +20,23 @@ BEGIN;
SELECT _v.register_patch('nexus-0001', NULL, NULL);
CREATE TABLE IF NOT EXISTS nexususers
- (id BIGSERIAL PRIMARY KEY
- ,username TEXT NOT NULL
- ,"password" TEXT NOT NULL
- ,superuser BOOLEAN NOT NULL
+ (id BIGINT GENERATED BY DEFAULT AS IDENTITY
+ ,username TEXT NOT NULL PRIMARY KEY
+ ,password TEXT NOT NULL
+ ,superuser BOOLEAN NOT NULL DEFAULT (false)
);
+COMMENT ON TABLE nexususers
+ IS 'xxx';
+COMMENT ON COLUMN nexususers.password
+ IS 'hashed password - FIXME: which hash, how encoded, salted?';
+
CREATE TABLE IF NOT EXISTS nexusbankconnections
(id BIGSERIAL PRIMARY KEY
,"connectionId" TEXT NOT NULL
- ,"type" TEXT NOT NULL
+ ,type TEXT NOT NULL
,dialect TEXT NULL
- ,"user" BIGINT NOT NULL
+ ,user BIGINT NOT NULL REFERENCES nexususers(id) ON DELETE CASCADE
,CONSTRAINT fk_nexusbankconnections_user_id FOREIGN KEY ("user") REFERENCES nexususers(id) ON DELETE RESTRICT ON UPDATE RESTRICT
);