-- +goose Up -- Read-only ICS calendar feeds: one token per tenant (all bookings) and one -- per staff member (their bookings only). The token is the secret — anyone -- holding the URL can read the feed, so tokens are rotatable from settings. -- Postgres backfills existing rows with random values via the DEFAULT. ALTER TABLE tenants ADD COLUMN IF NOT EXISTS feed_token text NOT NULL DEFAULT encode(gen_random_bytes(16), 'hex'); ALTER TABLE tenants ADD CONSTRAINT tenants_feed_token_key UNIQUE (feed_token); ALTER TABLE staff ADD COLUMN IF NOT EXISTS feed_token text NOT NULL DEFAULT encode(gen_random_bytes(16), 'hex'); ALTER TABLE staff ADD CONSTRAINT staff_feed_token_key UNIQUE (feed_token); -- +goose Down ALTER TABLE staff DROP COLUMN IF EXISTS feed_token; ALTER TABLE tenants DROP COLUMN IF EXISTS feed_token;