-- Gift cards: remember when the email went out, so cards set to arrive on a later day are sent by the cron job exactly once
ALTER TABLE gift_cards ADD COLUMN sent_at DATETIME NULL AFTER deliver_at;
UPDATE gift_cards SET sent_at=created_at WHERE deliver_at IS NULL OR deliver_at<=UTC_DATE();

INSERT INTO migrations (name) VALUES ('003_gift_card_delivery');
