Identity row for a product route. Scoped to (productId, vendorId, matcherHash) for live rows — the partial unique index
product_route_matcher_hash_unique enforces it. Mutable on
currentVersionId, vendorId, matcherHash, deletedAt, status, and
priority — every change to the matcher or vendor inserts a new
product_route_version row and re-points currentVersionId; the
sync_route_current_version_id trigger snaps vendorId and matcherHash
from the new version atomically.
currentVersionId is nullable in the column type because the FK target
doesn't exist yet at insert time; the service layer guarantees non-null
once the row's bootstrap version is created in the same transaction.
Identity row for a product route. Scoped to
(productId, vendorId, matcherHash)for live rows — the partial unique indexproduct_route_matcher_hash_uniqueenforces it. Mutable oncurrentVersionId,vendorId,matcherHash,deletedAt,status, andpriority— every change to the matcher or vendor inserts a newproduct_route_versionrow and re-pointscurrentVersionId; thesync_route_current_version_idtrigger snapsvendorIdandmatcherHashfrom the new version atomically.currentVersionIdis nullable in the column type because the FK target doesn't exist yet at insert time; the service layer guarantees non-null once the row's bootstrap version is created in the same transaction.