-- Add a "contact" role: an assignable person (end user) who cannot sign -- into the application, as distinct from admin/user login accounts. -- SQLite can't alter a CHECK constraint in place, so the table is rebuilt. CREATE TABLE users_new ( id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT NOT NULL UNIQUE, password_hash TEXT NOT NULL, role TEXT NOT NULL CHECK (role IN ('admin', 'user', 'contact')), enabled INTEGER NOT NULL DEFAULT 1, created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) ); INSERT INTO users_new (id, username, password_hash, role, enabled, created_at, updated_at) SELECT id, username, password_hash, role, enabled, created_at, updated_at FROM users; DROP TABLE users; ALTER TABLE users_new RENAME TO users;