Skip to content
Snippets Groups Projects
Commit 36a29359 authored by Jesse Norell's avatar Jesse Norell
Browse files

installer: remove duplicate mail_forwarding prior to adding unique key

parent b6698e08
No related branches found
No related tags found
No related merge requests found
<?php
if(!defined('INSTALLER_RUN')) die('Patch update file access violation.');
class upd_0094 extends installer_patch_update {
public function onBeforeSQL() {
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)");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment