mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-22 02:23:46 +00:00
f80876a52e
Add username field to the user data model as the foundation for the multi-user permissions system (PLAN-407, TASK-408). - SQLite migration 029 and Postgres migration 009 add username column with partial unique index (WHERE username != '') - User, UserCreate, UserUpdate Go structs updated - Store: CreateUser, UpdateUser, scanUser, userColumns updated - New GetUserByUsername store method (case-insensitive lookup) - All auth handler JSON payloads include username field - WorkspaceMember struct and ListWorkspaceMembers query include username - TypeScript User type and API client inline types updated Column is empty string by default; TASK-482 will backfill existing users and TASK-409 will add validation/registration flow support.
6 lines
324 B
SQL
6 lines
324 B
SQL
-- Add username column to users table.
|
|
-- Nullable initially (empty string = not yet set).
|
|
-- TASK-482 will backfill existing users and add NOT NULL constraint.
|
|
ALTER TABLE users ADD COLUMN IF NOT EXISTS username TEXT DEFAULT '';
|
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_users_username ON users(username) WHERE username != '';
|