teacher-tools/api/schema/auth.sql

12 lines
440 B
MySQL
Raw Normal View History

2025-01-23 17:10:32 +00:00
CREATE TABLE auth_user (
id BIGSERIAL PRIMARY KEY,
username VARCHAR(64) NOT NULL UNIQUE
CONSTRAINT username_check CHECK (LENGTH(username) >= 3),
password_hash VARCHAR(255) NOT NULL
CONSTRAINT password_check CHECK (LENGTH(password_hash) >= 32),
created_at BIGINT NOT NULL
DEFAULT EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000,
is_locked BOOLEAN NOT NULL DEFAULT FALSE,
is_admin BOOLEAN NOT NULL DEFAULT FALSE
2024-12-16 22:20:15 +00:00
);