Separate disable opened/clicked tracker to 2 options

This commit is contained in:
vladimir 2017-05-27 14:04:49 +02:00
parent 5c0aab1c3e
commit 59912e3c29
13 changed files with 134 additions and 60 deletions

View file

@ -69,7 +69,8 @@ CREATE TABLE `campaigns` (
`html_prepared` longtext,
`text` longtext,
`status` tinyint(4) unsigned NOT NULL DEFAULT '1',
`tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT '0',
`open_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT '0',
`click_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT '0',
`scheduled` timestamp NULL DEFAULT NULL,
`status_change` timestamp NULL DEFAULT NULL,
`delivered` int(11) unsigned NOT NULL DEFAULT '0',

View file

@ -65,7 +65,8 @@ CREATE TABLE `campaigns` (
`html_prepared` longtext,
`text` longtext,
`status` tinyint(4) unsigned NOT NULL DEFAULT '1',
`tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT '0',
`click_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT '0',
`open_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT '0',
`scheduled` timestamp NULL DEFAULT NULL,
`status_change` timestamp NULL DEFAULT NULL,
`delivered` int(11) unsigned NOT NULL DEFAULT '0',

View file

@ -0,0 +1,13 @@
# Header section
# Define incrementing schema version number
SET @schema_version = '28';
# Rename column tracking_disabled
ALTER TABLE `campaigns` ADD COLUMN `open_tracking_disabled` tinyint(4) unsigned DEFAULT 0 NOT NULL, ADD COLUMN `click_tracking_disabled` tinyint(4) unsigned DEFAULT 0 NOT NULL;
UPDATE `campaigns` SET `open_tracking_disabled` = `tracking_disabled`, `click_tracking_disabled` = `tracking_disabled`;
ALTER TABLE `campaigns` DROP COLUMN `tracking_disabled`;
# Footer section
LOCK TABLES `settings` WRITE;
INSERT INTO `settings` (`key`, `value`) VALUES('db_schema_version', @schema_version) ON DUPLICATE KEY UPDATE `value`=@schema_version;
UNLOCK TABLES;