Files
mixmaker/backend/migrations/008_cancelled_events.sql

15 lines
631 B
SQL

-- +mixmaker Up
ALTER TABLE events DROP CONSTRAINT IF EXISTS events_state_check;
ALTER TABLE events ADD CONSTRAINT events_state_check CHECK (state IN (
'RegistrationOpen', 'RegistrationClosed', 'Balancing',
'RostersDraft', 'RostersConfirmed', 'Live', 'Completed', 'Cancelled'
));
-- +mixmaker Down
UPDATE events SET state = 'Completed' WHERE state = 'Cancelled';
ALTER TABLE events DROP CONSTRAINT IF EXISTS events_state_check;
ALTER TABLE events ADD CONSTRAINT events_state_check CHECK (state IN (
'RegistrationOpen', 'RegistrationClosed', 'Balancing',
'RostersDraft', 'RostersConfirmed', 'Live', 'Completed'
));