fabaccess-bffh/migrations/2023-04-20-114002_create_userdb/up.sql

21 lines
485 B
MySQL
Raw Permalink Normal View History

2023-04-30 00:46:45 +02:00
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
password TEXT
);
CREATE TABLE IF NOT EXISTS user_kv (
id INTEGER PRIMARY KEY NOT NULL,
user INTEGER NOT NULL,
key TEXT NOT NULL,
value BLOB NOT NULL,
FOREIGN KEY (user) REFERENCES users(id)
);
CREATE TABLE IF NOT EXISTS user_roles (
id INTEGER PRIMARY KEY NOT NULL,
user INTEGER NOT NULL,
role TEXT NOT NULL,
FOREIGN KEY (user) REFERENCES users(id)
);