Commit 6211dedb authored by Marius Burkard's avatar Marius Burkard
Browse files

Merge branch '6229-duplicate-forwards-must-be-allowed-revert-for-6212' into 'develop'

Resolve "Duplicate forwards must be allowed, revert for #6212"

Closes #6229

See merge request !1522
parents 6c65d2b4 a0cf4fae
Pipeline #9440 passed with stage
in 14 seconds
......@@ -8,7 +8,7 @@ class upd_0094 extends installer_patch_update {
global $inst;
// Remove any duplicate mail_forwardings prior to adding unique key
$inst->db->query("DELETE FROM mail_forwarding WHERE forwarding_id IN (SELECT forwarding_id FROM (SELECT forwarding_id, COUNT(source) AS source_count FROM mail_forwarding GROUP BY source HAVING source_count > 1) as t1)");
//$inst->db->query("DELETE FROM mail_forwarding WHERE forwarding_id IN (SELECT forwarding_id FROM (SELECT forwarding_id, COUNT(source) AS source_count FROM mail_forwarding GROUP BY source HAVING source_count > 1) as t1)");
}
}
......@@ -7,7 +7,7 @@ ALTER TABLE `spamfilter_users` ALTER `policy_id` SET DEFAULT 0;
-- mail_forwarding.source must be unique
ALTER TABLE `mail_forwarding` DROP KEY `server_id`;
ALTER TABLE `mail_forwarding` ADD UNIQUE KEY `server_id` (`server_id`, `source`);
ALTER TABLE `mail_forwarding` ADD KEY `server_id` (`server_id`, `source`);
-- Purge apps & addons installer (#5795) - second time due to syntax error in 0093
DROP TABLE IF EXISTS `software_package`;
......
......@@ -918,7 +918,7 @@ CREATE TABLE `mail_forwarding` (
`allow_send_as` ENUM('n','y') NOT NULL DEFAULT 'n',
`greylisting` enum('n','y' ) NOT NULL DEFAULT 'n',
PRIMARY KEY (`forwarding_id`),
UNIQUE KEY `server_id` (`server_id`, `source`),
KEY `server_id` (`server_id`, `source`),
KEY `type` (`type`)
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......
......@@ -83,8 +83,6 @@ $form["tabs"]['alias'] = array (
),
'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
'errmsg'=> 'email_error_isemail'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'email_error_unique'),
),
'default' => '',
'value' => '',
......
......@@ -83,8 +83,6 @@ $form["tabs"]['forward'] = array (
),
'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
'errmsg'=> 'email_error_isemail'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'email_error_unique'),
),
'default' => '',
'value' => '',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment