cacert-boardvoting/internal/migrations/2022052701_add_vote_constrains.down.sql

16 lines
437 B
MySQL
Raw Permalink Normal View History

2022-05-27 15:39:54 +00:00
-- drop unique constraint for motion by specific voter from votes
CREATE TABLE votes_new
(
decision INTEGER NOT NULL,
voter INTEGER NOT NULL,
vote INTEGER NOT NULL,
voted DATETIME NOT NULL,
notes TEXT NOT NULL DEFAULT ''
);
INSERT INTO votes_new (decision, voter, vote, voted, notes)
SELECT decision, voter, vote, voted, notes
FROM votes;
DROP TABLE votes;
ALTER TABLE votes_new RENAME TO votes;