sql migration rollup

This commit is contained in:
2026-02-20 14:25:43 -06:00
parent a84c07082c
commit d629da32fa
2 changed files with 1 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ CREATE TABLE key (
-- Constraints -- Constraints
CONSTRAINT key_ref_lowercase CHECK (ref = LOWER(ref)), CONSTRAINT key_ref_lowercase CHECK (ref = LOWER(ref)),
CONSTRAINT key_ref_format CHECK (ref ~ '^([^.]+\.)?[^.]+$') CONSTRAINT key_ref_format CHECK (ref ~ '^[^.]+(\.[^.]+)*$')
); );
-- Unique index on owner_type, owner, name -- Unique index on owner_type, owner, name

View File

@@ -1,7 +0,0 @@
-- Migration: Relax key ref format constraint
-- Description: Allow multi-segment dot-separated key refs (e.g., "pack.prefix.name")
-- The original constraint only allowed at most one dot: '^([^.]+\.)?[^.]+$'
-- Sensors create refs like "python_example.counter.rule_ref" which have multiple dots.
ALTER TABLE key DROP CONSTRAINT key_ref_format;
ALTER TABLE key ADD CONSTRAINT key_ref_format CHECK (ref ~ '^[^.]+(\.[^.]+)*$');