docserver/sql/users.sql

28 lines
940 B
SQL

DROP TABLE users;
CREATE TABLE IF NOT EXISTS users
(
id INTEGER PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
fullname TEXT NOT NULL,
email TEXT NOT NULL,
description TEXT NOT NULL,
password TEXT NOT NULL,
otp_enabled BOOLEAN FALSE,
otp_verified BOOLEAN FALSE,
otp_base32 TEXT NOT NULL,
otp_auth_url TEXT NOT NULL,
otp_defs TEXT NOT NULL,
roles TEXT NOT NULL,
created TEXT NOT NULL,
lastaccess TEXT NOT NULL,
status TEXT NOT NULL,
items TEXT NOT NULL,
isadmin BOOLEAN FALSE
);
CREATE UNIQUE INDEX idx_users_email
ON users (email);
CREATE UNIQUE INDEX idx_users_fullname
ON users (name);