[Web] Database schema test
parent
31a9bb446c
commit
b81930e416
|
@ -3,7 +3,7 @@ function init_db_schema() {
|
||||||
try {
|
try {
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$db_version = "16022018_1419";
|
$db_version = "17022018_0839";
|
||||||
|
|
||||||
$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));
|
||||||
|
@ -21,6 +21,10 @@ function init_db_schema() {
|
||||||
AND active = '1'
|
AND active = '1'
|
||||||
AND address NOT LIKE '@%'
|
AND address NOT LIKE '@%'
|
||||||
GROUP BY goto;",
|
GROUP BY goto;",
|
||||||
|
"grouped_sender_acl" => "CREATE VIEW grouped_sender_acl (username, send_as_acl) AS
|
||||||
|
SELECT logged_in_as, IFNULL(GROUP_CONCAT(send_as SEPARATOR ' '), '') AS send_as_acl FROM sender_acl
|
||||||
|
WHERE send_as NOT LIKE '@%'
|
||||||
|
GROUP BY logged_in_as;",
|
||||||
"grouped_domain_alias_address" => "CREATE VIEW grouped_domain_alias_address (username, ad_alias) AS
|
"grouped_domain_alias_address" => "CREATE VIEW grouped_domain_alias_address (username, ad_alias) AS
|
||||||
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
|
LEFT OUTER JOIN alias_domain ON target_domain=domain
|
||||||
|
@ -154,7 +158,7 @@ function init_db_schema() {
|
||||||
),
|
),
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
||||||
),
|
),
|
||||||
"quarantine" => array(
|
"quarantaine" => array(
|
||||||
"cols" => array(
|
"cols" => array(
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
"id" => "INT NOT NULL AUTO_INCREMENT",
|
||||||
"qid" => "VARCHAR(30) NOT NULL",
|
"qid" => "VARCHAR(30) NOT NULL",
|
||||||
|
@ -245,8 +249,8 @@ function init_db_schema() {
|
||||||
"syncjobs" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"syncjobs" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"eas_reset" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"eas_reset" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"filters" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"filters" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"quarantine" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"quarantaine" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"bcc_maps" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
"bcc_maps" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"recipient_maps" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
"recipient_maps" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
||||||
),
|
),
|
||||||
"keys" => array(
|
"keys" => array(
|
||||||
|
@ -622,6 +626,7 @@ function init_db_schema() {
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($tables as $table => $properties) {
|
foreach ($tables as $table => $properties) {
|
||||||
|
// Migrate to quarantine
|
||||||
if ($table == 'quarantine') {
|
if ($table == 'quarantine') {
|
||||||
$stmt = $pdo->query("SHOW TABLES LIKE 'quarantaine'");
|
$stmt = $pdo->query("SHOW TABLES LIKE 'quarantaine'");
|
||||||
$num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC));
|
$num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC));
|
||||||
|
|
Loading…
Reference in New Issue