"...internal/handler/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "62dc0b953bbfbb4ed8d9a19fc64c9659a153ddc3"
Commit d17f853a authored by yangjianbo's avatar yangjianbo
Browse files

fix(数据库): 补充允许分组列兼容迁移

parent ef5a4105
-- 兼容旧库:若尚未创建 user_allowed_groups,则确保 users.allowed_groups 存在,避免 007 迁移回填失败。
DO $$
BEGIN
IF to_regclass('public.user_allowed_groups') IS NULL THEN
IF EXISTS (
SELECT 1
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name = 'users'
) THEN
ALTER TABLE users
ADD COLUMN IF NOT EXISTS allowed_groups BIGINT[] DEFAULT NULL;
END IF;
END IF;
END $$;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment