mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
upgrade_1050():
- add index on (domain,timestamp) in log table to make viewlog faster _add_index(): - fix handling of multi-column aliases in MySQL git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1050 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
parent
f6cb50e914
commit
0247de425a
@ -270,6 +270,7 @@ function _add_index($table, $indexname, $fieldlist) {
|
||||
$table = table_by_key ($table);
|
||||
|
||||
if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) {
|
||||
$fieldlist = str_replace(',', '`,`', $fieldlist); # fix quoting if index contains multiple fields
|
||||
return "ALTER TABLE $table ADD INDEX `$indexname` ( `$fieldlist` )";
|
||||
} elseif($CONF['database_type'] == 'pgsql') {
|
||||
$pgindexname = $table . "_" . $indexname . '_idx';
|
||||
@ -1298,6 +1299,10 @@ function upgrade_968_pgsql() {
|
||||
db_query_parsed("ALTER TABLE $table_mailbox ALTER COLUMN quota type bigint");
|
||||
}
|
||||
|
||||
function upgrade_1050() {
|
||||
db_query_parsed(_add_index('log', 'domain_timestamp', 'domain,timestamp'));
|
||||
}
|
||||
|
||||
# TODO MySQL:
|
||||
# - various varchar fields do not have a default value
|
||||
# https://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/3419725
|
||||
|
Loading…
Reference in New Issue
Block a user