-- An invitation can come with a package: a promo code made with it, sent in -- the e-mail and redeemed by itself when the invitee signs up. ALTER TABLE promo_codes ADD COLUMN invitation_id uuid UNIQUE REFERENCES invitations (id) ON DELETE SET NULL;