Files
tenant-registry/migrations/0018_preview_grants.up.sql
sharang fdebac1735
ci / shared (push) Successful in 18s
ci / test (push) Successful in 25m44s
ci / image (push) Successful in 41s
feat(entitlements): Staff preview grants for products not for sale yet (#72)
2026-10-14 08:42:40 +00:00

9 lines
549 B
SQL

-- Staff preview grants (tenant-registry ADR 0001 follow-up, Werkmeister W1):
-- a tenant may use a product that is not for sale yet (catalogue enabled =
-- false) while preview is true and preview_expires_at lies ahead. A real
-- booking clears both. Kept apart from expires_at, the booking's period end.
ALTER TABLE tenant_products
ADD COLUMN preview BOOLEAN NOT NULL DEFAULT FALSE,
ADD COLUMN preview_expires_at TIMESTAMPTZ,
ADD CONSTRAINT tenant_products_preview_expiry CHECK (preview = (preview_expires_at IS NOT NULL));