 , tippee                text                        NOT NULL REFERENCES participants ON UPDATE CASCADE ON DELETE RESTRICT
 , amount                numeric(35,2)               NOT NULL
 , context               context_type                NOT NULL
+, payday                integer                     DEFAULT NULL REFERENCES paydays
+                                                        ON UPDATE RESTRICT
+                                                        ON DELETE RESTRICT
  );
 
 -- https://github.com/gratipay/gratipay.com/pull/2723

    ('unresolved', 'pending-payout', 'resolved');


-- https://github.com/gratipay/gratipay.com/pull/3730
BEGIN;

    ALTER TABLE transfers ADD COLUMN payday integer DEFAULT NULL
        REFERENCES paydays ON UPDATE RESTRICT ON DELETE RESTRICT;

END;


-- https://github.com/gratipay/gratipay.com/pull/3733
BEGIN;


CREATE INDEX transfers_timestamp_idx ON transfers (timestamp);
CREATE INDEX transfers_tipper_idx ON transfers (tipper);
CREATE INDEX transfers_tippee_idx ON transfers (tippee);


-- https://github.com/gratipay/gratipay.com/pull/3282
