[Web] Create new id on sieve filter update by using md5, fixes #750

master
André 2017-11-14 21:11:36 +01:00
parent 012283296f
commit a5abca4c34
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ function init_db_schema() {
try { try {
global $pdo; global $pdo;
$db_version = "14112017_1149"; $db_version = "14112017_2103";
$stmt = $pdo->query("SHOW TABLES LIKE 'versions'"); $stmt = $pdo->query("SHOW TABLES LIKE 'versions'");
$num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC)); $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC));
@ -29,10 +29,10 @@ function init_db_schema() {
SELECT username, IFNULL(GROUP_CONCAT(local_part, '@', alias_domain SEPARATOR ' '), '') AS ad_alias FROM mailbox SELECT username, IFNULL(GROUP_CONCAT(local_part, '@', alias_domain SEPARATOR ' '), '') AS ad_alias FROM mailbox
LEFT OUTER JOIN alias_domain on target_domain=domain GROUP BY username;", LEFT OUTER JOIN alias_domain on target_domain=domain GROUP BY username;",
"sieve_before" => "CREATE VIEW sieve_before (id, username, script_name, script_data) AS "sieve_before" => "CREATE VIEW sieve_before (id, username, script_name, script_data) AS
SELECT id, username, script_name, script_data FROM sieve_filters SELECT md5(script_data), username, script_name, script_data FROM sieve_filters
WHERE filter_type = 'prefilter';", WHERE filter_type = 'prefilter';",
"sieve_after" => "CREATE VIEW sieve_after (id, username, script_name, script_data) AS "sieve_after" => "CREATE VIEW sieve_after (id, username, script_name, script_data) AS
SELECT id, username, script_name, script_data FROM sieve_filters SELECT md5(script_data), username, script_name, script_data FROM sieve_filters
WHERE filter_type = 'postfilter';" WHERE filter_type = 'postfilter';"
); );