cacert-boardvoting/boardvoting/migrations/20170421143052_fix_duplicates.sql

30 lines
1 KiB
MySQL
Raw Permalink Normal View History

2019-07-31 15:30:58 +00:00
/*
Copyright 2017-2019 Jan Dittberner
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this program except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
2017-04-21 12:50:34 +00:00
-- +migrate Up
2017-04-21 12:50:34 +00:00
-- SQL in section 'Up' is executed when this migration is applied
-- Peter Yuill has a duplicate entry in the voters table he has ids 17 and 31
UPDATE votes SET voter=17 WHERE voter=31;
UPDATE decisions SET proponent=17 WHERE proponent=31;
DELETE FROM emails WHERE voter=31;
DELETE FROM voters WHERE id=31;
-- +migrate Down
2017-04-21 12:50:34 +00:00
-- SQL section 'Down' is executed when this migration is rolled back
-- There is no useful backward migration