Files
sorsfonalak/crates/db/migrations/0023_invitation_package.sql
T
fecoandClaude Opus 5.5 7b23d71526
CI / test (push) Successful in 1m15s
CI / build (push) Successful in 5m15s
CI / deploy (push) Skipped
Invitations with a package; promo codes fill up the balance
An admin can pick a package when inviting: each invitee gets a promo code
(in the e-mail and its preview, kept on resend), redeemed by itself at sign
up; revoking the invitation withdraws it, and the list shows the package.

Redeeming a promo code now fills the units up to the package's amounts:
used units come back, more than that stays. A code that would add nothing
stays open, with a message saying so; the answer tells what was added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-19 09:57:01 +00:00

4 lines
250 B
SQL

-- 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;