fix: resolve P0/P1 code quality issues
P0 fixes: - ModelError.Is(): use exact matching instead of substring contains() - shouldClearStickySession: add context param for cancellation/tracing P1 fixes: - TODO stubs: return 501 Not Implemented errors - validateInstanceSignature: deduplicate to shared validateCodeSignature() - Error messages: standardize to English only - http.go: remove pseudo if-else with duplicate branches
This commit is contained in:
27
backend/migrations/006b_guard_users_allowed_groups.sql
Normal file
27
backend/migrations/006b_guard_users_allowed_groups.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- 兼容缺失 users.allowed_groups 的老库,确保 007 回填可执行。
|
||||
DO $$
|
||||
BEGIN
|
||||
IF EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'users'
|
||||
) THEN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'users'
|
||||
AND column_name = 'allowed_groups'
|
||||
) THEN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM schema_migrations
|
||||
WHERE filename = '014_drop_legacy_allowed_groups.sql'
|
||||
) THEN
|
||||
ALTER TABLE users
|
||||
ADD COLUMN IF NOT EXISTS allowed_groups BIGINT[] DEFAULT NULL;
|
||||
END IF;
|
||||
END IF;
|
||||
END IF;
|
||||
END $$;
|
||||
Reference in New Issue
Block a user