nex_basse/backend/docs/migrations/001_user_status.sql

7 lines
341 B
MySQL
Raw Permalink Normal View History

2026-02-25 08:48:31 +00:00
-- Add status column to sys_user and backfill from is_active
ALTER TABLE sys_user ADD COLUMN status VARCHAR(20) NOT NULL DEFAULT 'enabled';
UPDATE sys_user SET status = CASE WHEN is_active = 1 THEN 'enabled' ELSE 'disabled' END;
-- Optional cleanup (uncomment if you want to remove is_active)
-- ALTER TABLE sys_user DROP COLUMN is_active;