mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-27 13:06:20 +02:00
* fix(attribution): remove legacy invariant exemption Co-authored-by: multica-agent <github@multica.ai> * test(attribution): enforce strict legacy row rejection Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: Eve <eve@multica-ai.local> Co-authored-by: multica-agent <github@multica.ai>
16 lines
565 B
SQL
16 lines
565 B
SQL
-- PostgreSQL cannot mark a validated constraint NOT VALID again. Recreate the
|
|
-- shadow constraint to restore the state immediately after migration 197.
|
|
ALTER TABLE agent_task_queue
|
|
DROP CONSTRAINT IF EXISTS agent_task_queue_accountable_matches_originator_strict;
|
|
|
|
ALTER TABLE agent_task_queue
|
|
ADD CONSTRAINT agent_task_queue_accountable_matches_originator_strict
|
|
CHECK (
|
|
originator_user_id IS NULL
|
|
OR (
|
|
accountable_user_id IS NOT NULL
|
|
AND accountable_user_id = originator_user_id
|
|
)
|
|
)
|
|
NOT VALID;
|