db update to add index for item.obj_type

This commit is contained in:
git-marijus
2017-07-31 16:49:56 +02:00
committed by Mario Vavti
parent a3fef34a3f
commit d33974cec4
4 changed files with 18 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1192 );
define( 'UPDATE_VERSION' , 1193 );
/**
*
@@ -2963,6 +2963,18 @@ function update_r1191() {
return UPDATE_FAILED;
}
}
}
function update_r1192() {
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("CREATE INDEX item_obj_type ON item (obj_type)");
}
else {
$r1 = q("ALTER TABLE item ADD INDEX (obj_type)");
}
if($r1)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}