From e3e669dc71f30b2771f67863633c37a5d791ba37 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 12 Oct 2017 12:00:48 -0400 Subject: [PATCH] Bug 14826 [QA Followup] - Make db update idempotent --- installer/data/mysql/atomicupdate/bug_14826.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_14826.sql b/installer/data/mysql/atomicupdate/bug_14826.sql index bfbcf1b..6ef3eba 100644 --- a/installer/data/mysql/atomicupdate/bug_14826.sql +++ b/installer/data/mysql/atomicupdate/bug_14826.sql @@ -1,4 +1,6 @@ -CREATE TABLE `account_offset_types` ( +DROP TABLE IF EXISTS `accountoffsets`; + +CREATE TABLE IF NOT EXISTS `account_offset_types` ( `type` varchar(16) NOT NULL, -- The type of offset this is PRIMARY KEY (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -16,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `account_offsets` ( CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -INSERT INTO account_offset_types ( type ) VALUES +INSERT IGNORE INTO account_offset_types ( type ) VALUES ('Writeoff'), ('Payment'), ('Lost Item'), -- 2.10.2