Commit 36a29359 authored by Jesse Norell's avatar Jesse Norell
Browse files

installer: remove duplicate mail_forwarding prior to adding unique key

parent b6698e08
Pipeline #9322 passed with stage
in 10 minutes and 49 seconds
<?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)");
}
}
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