krona-staff/migrations/0012_sync_contract_hardening.down.sql
2026-09-29 12:23:17 +07:00

16 lines
625 B
SQL

ALTER TABLE staff_sync_command_inbox
DROP CONSTRAINT IF EXISTS staff_sync_command_inbox_correlation_id_check,
DROP CONSTRAINT IF EXISTS staff_sync_command_inbox_causation_id_check;
ALTER TABLE staff_sync_command_inbox
ALTER COLUMN correlation_id TYPE VARCHAR(36),
ALTER COLUMN causation_id TYPE VARCHAR(36);
ALTER TABLE staff_sync_devices
DROP CONSTRAINT IF EXISTS staff_sync_devices_tenant_id_org_unit_id_fkey;
ALTER TABLE staff_sync_devices
ADD CONSTRAINT staff_sync_devices_tenant_id_org_unit_id_fkey
FOREIGN KEY (tenant_id, org_unit_id)
REFERENCES staff_org_units (tenant_id, id)
ON DELETE SET NULL;