fix(iam): allow wildcard scope in schema seed

This commit is contained in:
Your Name
2026-04-20 16:11:26 +08:00
parent 319d9e1989
commit 566169687a
2 changed files with 142 additions and 1 deletions

View File

@@ -57,7 +57,10 @@ CREATE TABLE IF NOT EXISTS iam_scopes (
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- 约束
CONSTRAINT chk_scope_code_format CHECK (code ~ '^[a-z][a-z0-9._]{0,63}$')
CONSTRAINT chk_scope_code_format CHECK (
code = '*'
OR code ~ '^[a-z][a-z0-9._]{0,63}$'
)
);
CREATE INDEX IF NOT EXISTS idx_iam_scopes_code ON iam_scopes (code);