cacert-boardvoting/internal/migrations/2022052702_add_emails_constrains.down.sql

15 lines
275 B
MySQL
Raw Normal View History

2022-05-27 15:39:54 +00:00
-- drop constraints from votes table
CREATE TABLE emails_new
(
voter INT4,
address VARCHAR(255)
);
INSERT INTO emails_new (voter, address)
SELECT voter, address
FROM emails;
DROP TABLE emails;
ALTER TABLE emails_new
RENAME TO emails;
DROP TABLE emails_backup;