import type { PoolClient } from 'pg'; /** * Package management (parcel sizing) — schema, part 1 of 3. * See wiki/package-management-design.md. * * Creates the `package` table (admin-managed box/envelope sizes) and the * `product.package_id` reference. Both live in THIS catalog migration on * purpose: the FK must never depend on cross-module migration ordering. * * Units: `length`/`width`/`height` are stored in the store's dimension unit * (`shop.dimensionUnit`, default 'cm'); the tare `weight` (the EMPTY * package's own weight, added to shipping weight for quotes and labels) is * stored in the store's weight unit (`shop.weightUnit`). No per-row unit * columns — same model and same unit-change caveat as `product.weight`. * * `height >= 0` (not > 0): a flat envelope is height 0. * * The partial unique index makes "at most one default" a database guarantee — * the service-level default swap can race, the index cannot. * * Seed row: product creation makes the package selector mandatory for * shippable products and preselects the default; without a seed, a fresh * install dead-ends ("no packages exist"). Merchants rename/edit it. * * `product.package_id` is NULLABLE on purpose — legacy products keep NULL * until next edited; mandatory-ness is application-level and applies to * shippable products only. ON DELETE RESTRICT: a package referenced by * products cannot be deleted (the service reports the count). */ declare const _default: (connection: PoolClient) => Promise; export default _default;