Update database.php

This commit is contained in:
Namhyeon Go 2020-01-09 13:08:05 +09:00 committed by GitHub
parent a142488ccc
commit 9fb4ea7b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -791,6 +791,8 @@ if(!check_function_exists("exec_db_table_create")) {
$config = get_config();
$setindex = get_value_in_array("setindex", $options, false);
$setunique = get_value_in_array("setunique", $options, false);
$setfulltext = get_value_in_array("setfulltext", $options, false);
$setspatial = get_value_in_array("setspatial", $options, false);
// check if exists table
$bind = array(
@ -847,7 +849,19 @@ if(!check_function_exists("exec_db_table_create")) {
foreach($setunique as $k=>$v) {
$sql = sprintf("create unique index `%s` on `%s` (%s)", $k, $_tablename, implode(", ", $v));
exec_db_query($sql);
}
}
// create fulltext (type of index)
foreach($setfulltext as $k=>$v) {
$sql = sprintf("create fulltext index `%s` on `%s` (%s)", $k, $_tablename, implode(", ", $v));
exec_db_query($sql);
}
// create spatial(geometry) (type of index)
foreach($setspatial as $k=>$v) {
$sql = sprintf("create spatial index `%s` on `%s` (%s)", $k, $_tablename, implode(", ", $v));
exec_db_query($sql);
}
}
return $_tablename;