TTime/backend/internal/database/migrations/0010_users.sql

13 lines
434 B
MySQL
Raw Normal View History

2024-03-12 20:44:54 +01:00
-- Id is a surrogate key for in ternal use
-- userId is what is used for external id
-- username is what is used for login
-- password is the hashed password
2024-02-26 00:12:13 +01:00
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username VARCHAR(255) NOT NULL UNIQUE,
2024-02-26 00:12:13 +01:00
password VARCHAR(255) NOT NULL
);
2024-03-12 20:44:54 +01:00
-- Users are commonly searched by username and userId
CREATE INDEX IF NOT EXISTS users_username_index ON users (username);