fix(data): break tenants->company FK before import wipe (un-red main, PMS-648) #441
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-648-data-import"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #440: main's integration round-trip still fails because the FK-break fix (the actual import bug) was not in #440 at merge time - only the test change was.
The wipe-and-replace import failed deleting companies: tenants.own_company_id is a RESTRICT FK into companies (migration 062), and tenants is not a tenant-scoped table so it is neither exported nor wiped - its reference blocked the delete. Before wiping, NULL any tenants FK column pointing into a load table for this tenant's row (own_company_id is nullable) and restore them to the remapped ids after the load.
Un-reds main's Integration check.
#PMS-648