ALTER TABLE "users"
  ADD COLUMN IF NOT EXISTS "username" TEXT,
  ADD COLUMN IF NOT EXISTS "department_id" TEXT,
  ADD COLUMN IF NOT EXISTS "role_id" TEXT NOT NULL DEFAULT 'member',
  ADD COLUMN IF NOT EXISTS "phone" TEXT NOT NULL DEFAULT '',
  ADD COLUMN IF NOT EXISTS "password" TEXT NOT NULL DEFAULT '',
  ADD COLUMN IF NOT EXISTS "is_system" BOOLEAN NOT NULL DEFAULT false;

CREATE UNIQUE INDEX IF NOT EXISTS "users_username_key" ON "users"("username");
