From 8f05b54c0f835b87d01f31a40cbd17ce880b8e74 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Tue, 13 Oct 2020 18:29:42 +0200 Subject: [PATCH] #54 user accounts - db --- migrations/002-users.sql | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 migrations/002-users.sql diff --git a/migrations/002-users.sql b/migrations/002-users.sql new file mode 100644 index 000000000..13eb33deb --- /dev/null +++ b/migrations/002-users.sql @@ -0,0 +1,23 @@ +-- Up + +CREATE TABLE users ( + id TEXT NOT NULL PRIMARY KEY, + username TEXT NOT NULL, + email TEXT NOT NULL, + roles TEXT NOT NULL, + avatarSource TEXT +); + +CREATE TABLE authenticators ( + id TEXT NOT NULL PRIMARY KEY, + userId TEXT NOT NULL, + type TEXT NOT NULL, + payload TEXT NOT NULL, + validUntil INTEGER, + FOREIGN KEY(userId) REFERENCES users(id) +); + +-- Down + +DROP TABLE authenticators; +DROP TABLE users;