From 9fb4ea7b13c9e192f9ef0fb60a8b47fa8e681fca Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 9 Jan 2020 13:08:05 +0900 Subject: [PATCH] Update database.php --- system/database.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/system/database.php b/system/database.php index 2beb440..12ded21 100644 --- a/system/database.php +++ b/system/database.php @@ -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;