Migration 127 lands curie's audit-doc Tier 0 sweep (docs/research- deadlines-completeness-2026-05-25.md section 10) plus the UPC Statement of Claim citation backfill from m/paliad#99. 14 single-row UPDATEs touching UPC + DE-LG + DPMA + EPA proceedings: T0.1 upc.rev.cfi.defence dur 3mo -> 2mo (RoP.049.1) T0.2 upc.rev.cfi.rejoin dur 2mo -> 1mo (RoP.052) T0.3 upc.apl.merits.response dur 2mo -> 3mo (RoP.235.1) T0.4 de.inf.lg.beruf_begr parent_id berufung -> NULL (ZPO 520.2) T0.7 upc.rev.cfi.reply citation backfill RoP.051 T0.9 upc.apl.merits.notice citation RoP.220.1 -> RoP.224.1.a T0.10 upc.apl.merits.grounds citation RoP.220.1 -> RoP.224.2.a T0.12 dpma.opp.dpma.erwiderung flip is_court_set, drop PatG 59.3 T0.13 dpma.appeal.bpatg.begruendung flip is_court_set, drop PatG 75.1 T0.14 de.null.bpatg.erwidg citation PatG 82.1 -> PatG 82.3 T0.15 de.null.bgh.begruendung citation PatG 111.1 -> ZPO 520.2 (via PatG 117) T0.16 de.null.bgh.erwiderung flip is_court_set, recite as ZPO 521.2 (via PatG 117) T0.17 epa.opp.opd.erwidg flip is_court_set (EPO Guidelines D-IV 5.2) #99 upc.inf.cfi.soc backfill UPC RoP R.13(1) citation T0.5 and T0.6 (de.inf.lg.replik / .duplik) shipped separately as mig 124 (m/paliad#95). T0.8 / T0.11 dedup'd into T0.2 / T0.1 per the audit doc. Each UPDATE guarded by a WHERE clause matching only the pre-fix row state (mig 095 convention) - re-apply against a DB carrying the fix matches zero rows and no-ops, no duplicate deadline_rule_ audit entries on idempotent re-runs. Verification DO block at the end RAISE EXCEPTIONs if any row remains in inconsistent state. Applied to live youpc DB via Supabase MCP with audit_reason set (13 rows touched - T0.4 also fired; all 14 verified in post-fix shape via direct query). applied_migrations entry NOT pre-recorded; the boot-time runner inserts version=127 cleanly on next deploy because every guarded UPDATE no-ops at that point. Build hygiene: go build / go test ./internal/... / bun run build all clean (2824 i18n keys, no scan warnings). No code changes - pure data migration. Cites: UPC RoP (UPCRoP.013.1 / 049.1 / 051 / 052 / 224.1.a / 224.2.a / 235.1), PatG 82.3 / 117, ZPO 520.2 / 521.2, EPC R.79(1) + EPO Guidelines D-IV 5.2.
147 lines
4.6 KiB
SQL
147 lines
4.6 KiB
SQL
-- Revert t-paliad-263 Wave 0 + m/paliad#99.
|
|
-- Restores each Tier 0 row to its pre-fix state per
|
|
-- docs/research-deadlines-completeness-2026-05-25.md §10. T0.5 and
|
|
-- T0.6 are NOT reverted here — they live in mig 124's down.
|
|
--
|
|
-- audit_reason set_config required for the mig 079 trigger.
|
|
|
|
SELECT set_config(
|
|
'paliad.audit_reason',
|
|
'mig 127 revert: unwind Tier 0 deadline-rule corrections (Wave 0 + #99)',
|
|
true);
|
|
|
|
-- T0.1 defence: 2mo + RoP.049.1 → 3mo + RoP.49.1
|
|
UPDATE paliad.deadline_rules
|
|
SET duration_value = 3,
|
|
rule_code = 'RoP.49.1',
|
|
updated_at = now()
|
|
WHERE submission_code = 'upc.rev.cfi.defence'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.2 rejoin: 1mo + RoP.052/UPC.RoP.52 → 2mo + NULL/NULL
|
|
UPDATE paliad.deadline_rules
|
|
SET duration_value = 2,
|
|
rule_code = NULL,
|
|
legal_source = NULL,
|
|
updated_at = now()
|
|
WHERE submission_code = 'upc.rev.cfi.rejoin'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.3 response: 3mo + RoP.235.1 → 2mo + NULL
|
|
UPDATE paliad.deadline_rules
|
|
SET duration_value = 2,
|
|
rule_code = NULL,
|
|
legal_source = NULL,
|
|
updated_at = now()
|
|
WHERE submission_code = 'upc.apl.merits.response'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.4 beruf_begr: parent_id NULL → de.inf.lg.berufung
|
|
UPDATE paliad.deadline_rules
|
|
SET parent_id = (
|
|
SELECT id FROM paliad.deadline_rules
|
|
WHERE submission_code = 'de.inf.lg.berufung'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published'
|
|
LIMIT 1
|
|
),
|
|
updated_at = now()
|
|
WHERE submission_code = 'de.inf.lg.beruf_begr'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.7 reply: clear citation
|
|
UPDATE paliad.deadline_rules
|
|
SET rule_code = NULL,
|
|
legal_source = NULL,
|
|
updated_at = now()
|
|
WHERE submission_code = 'upc.rev.cfi.reply'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.9 notice: revert citation
|
|
UPDATE paliad.deadline_rules
|
|
SET rule_code = 'RoP.220.1',
|
|
legal_source = 'UPC.RoP.220.1',
|
|
updated_at = now()
|
|
WHERE submission_code = 'upc.apl.merits.notice'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.10 grounds: revert citation
|
|
UPDATE paliad.deadline_rules
|
|
SET rule_code = 'RoP.220.1',
|
|
legal_source = 'UPC.RoP.220.1',
|
|
updated_at = now()
|
|
WHERE submission_code = 'upc.apl.merits.grounds'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.12 dpma.opp erwiderung: restore court-set=false + §59 citation
|
|
UPDATE paliad.deadline_rules
|
|
SET is_court_set = false,
|
|
rule_code = '§ 59 PatG',
|
|
legal_source = 'DE.PatG.59.3',
|
|
updated_at = now()
|
|
WHERE submission_code = 'dpma.opp.dpma.erwiderung'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.13 dpma.appeal.bpatg begründung: restore court-set=false + §75 citation
|
|
UPDATE paliad.deadline_rules
|
|
SET is_court_set = false,
|
|
rule_code = '§ 75 PatG',
|
|
legal_source = 'DE.PatG.75.1',
|
|
updated_at = now()
|
|
WHERE submission_code = 'dpma.appeal.bpatg.begruendung'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.14 bpatg erwidg: revert citation
|
|
UPDATE paliad.deadline_rules
|
|
SET rule_code = '§ 82 PatG',
|
|
legal_source = 'DE.PatG.82.1',
|
|
updated_at = now()
|
|
WHERE submission_code = 'de.null.bpatg.erwidg'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.15 bgh begründung: revert citation
|
|
UPDATE paliad.deadline_rules
|
|
SET rule_code = '§ 111 PatG',
|
|
legal_source = 'DE.PatG.111.1',
|
|
updated_at = now()
|
|
WHERE submission_code = 'de.null.bgh.begruendung'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.16 bgh erwiderung: revert court-set + citation
|
|
UPDATE paliad.deadline_rules
|
|
SET is_court_set = false,
|
|
rule_code = '§ 111 PatG',
|
|
legal_source = 'DE.PatG.111.3',
|
|
updated_at = now()
|
|
WHERE submission_code = 'de.null.bgh.erwiderung'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- T0.17 epa.opp opd erwidg: revert court-set
|
|
UPDATE paliad.deadline_rules
|
|
SET is_court_set = false,
|
|
updated_at = now()
|
|
WHERE submission_code = 'epa.opp.opd.erwidg'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|
|
|
|
-- #99 upc.inf.cfi.soc: clear citation backfill
|
|
UPDATE paliad.deadline_rules
|
|
SET rule_code = NULL,
|
|
legal_source = NULL,
|
|
updated_at = now()
|
|
WHERE submission_code = 'upc.inf.cfi.soc'
|
|
AND is_active = true
|
|
AND lifecycle_state = 'published';
|