KB-3B62

P3D B3-F1c-c Scheduler Rollback SQL (COMPILED, NOT EXECUTED)

3 min read Revision 1

P3D — B3-F1c-c Scheduler Rollback (COMPILED)

Date: 2026-05-13 Mode: COMPILE-ONLY. NOT EXECUTED. Scope: B3-F1c-c artifacts ONLY. Does NOT touch fn_birth_onboarding_full_scan, B3-F1b gate/helper/trigger, sibling dot_config policies, or system_issues data.


Compiled rollback SQL

-- =========================================================================
-- B3-F1c-c rollback. DO NOT EXECUTE without explicit go-ahead.
-- Strictly scoped: removes only the artifacts that the B3-F1c-c seed scripts
-- create. Anything pre-existing (fn_birth_onboarding_full_scan, B3-F1b
-- helpers/triggers, sibling birth-trigger policies, B3-A pivot work) is
-- preserved.
-- =========================================================================

BEGIN;

-- 1. Drop the dot_tools registration first (refers to the Flow by name in
--    extra_metadata; remove before the Flow disappears).
DELETE FROM dot_tools
WHERE code = 'DOT-BIRTH-ONBOARD-FULLSCAN';

-- 2. Drop the Directus Flow's child operation, THEN the flow row.
--    Use the flow name as the anchor because the seed generates UUIDs at
--    insert time (we don't know them in advance).
DELETE FROM directus_operations
WHERE flow IN (
  SELECT id FROM directus_flows
  WHERE name = '[BIRTH] Onboarding Full Scan (candidate 6h)'
);

DELETE FROM directus_flows
WHERE name = '[BIRTH] Onboarding Full Scan (candidate 6h)';

-- 3. Remove the B3-F1c-c policy keys (and ONLY those).
DELETE FROM dot_config
WHERE key IN (
  'policy.birth_full_scan.enabled',
  'policy.birth_full_scan.cadence_cron'
);

-- 4. INTENTIONALLY NOT TOUCHED:
--    - public.fn_birth_onboarding_full_scan         (B3-F1c-a/b artifact, governed elsewhere)
--    - policy.birth_trigger.*                       (B3-A sibling)
--    - system_issues data                           (observability stream)
--    - DOT-TAC-BIRTH-GATE, DOT-TAC-BIRTH-VERIFY     (pre-existing dot_tools)
--    - Nuxt endpoint file at /api/birth/onboarding/full-scan
--      (manual filesystem removal; outside SQL scope)

COMMIT;

Manual cleanup (outside SQL)

If a Nuxt endpoint file is eventually created at /opt/incomex/docker/nuxt-repo/web/server/api/birth/onboarding/full-scan.post.ts, removing it is a filesystem operation:

rm /opt/incomex/docker/nuxt-repo/web/server/api/birth/onboarding/full-scan.post.ts

…followed by a Nuxt rebuild/restart per the repo's deploy convention. Not in the COMPILE-ONLY scope of B3-F1c-c-a.

B3-F1c-c Scheduler Artifacts | COMPILE-ONLY | 2026-05-13

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/artifacts/p3d-birth-system-b3f1c-c-scheduler-rollback.sql.md