improve abconfig queries
This commit is contained in:
parent
9e1af2492f
commit
55e1026c98
28
Zotlabs/Update/_1213.php
Normal file
28
Zotlabs/Update/_1213.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Update;
|
||||
|
||||
class _1213 {
|
||||
|
||||
function run() {
|
||||
if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
|
||||
q("START TRANSACTION");
|
||||
|
||||
$r = q("ALTER TABLE abconfig
|
||||
DROP INDEX chan,
|
||||
DROP INDEX xchan,
|
||||
ADD INDEX chan_xchan (chan, xchan)
|
||||
");
|
||||
|
||||
if($r) {
|
||||
q("COMMIT");
|
||||
return UPDATE_SUCCESS;
|
||||
}
|
||||
else {
|
||||
q("ROLLBACK");
|
||||
return UPDATE_FAILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
2
boot.php
2
boot.php
@ -54,7 +54,7 @@ define ( 'STD_VERSION', '3.5.6' );
|
||||
define ( 'ZOT_REVISION', '6.0a' );
|
||||
|
||||
|
||||
define ( 'DB_UPDATE_VERSION', 1212 );
|
||||
define ( 'DB_UPDATE_VERSION', 1213 );
|
||||
|
||||
define ( 'PROJECT_BASE', __DIR__ );
|
||||
|
||||
|
@ -7,8 +7,7 @@ CREATE TABLE IF NOT EXISTS `abconfig` (
|
||||
`k` char(191) NOT NULL DEFAULT '',
|
||||
`v` mediumtext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `chan` (`chan`),
|
||||
KEY `xchan` (`xchan`),
|
||||
KEY `chan_xchan` (`chan`, `xchan`),
|
||||
KEY `cat` (`cat`),
|
||||
KEY `k` (`k`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
Reference in New Issue
Block a user