Update database.php
This commit is contained in:
parent
ca4a0d7a37
commit
50cc0d6207
|
@ -770,6 +770,7 @@ if(!check_function_exists("exec_db_table_create")) {
|
||||||
// get index options
|
// get index options
|
||||||
$config = get_config();
|
$config = get_config();
|
||||||
$setindex = get_value_in_array("setindex", $options, false);
|
$setindex = get_value_in_array("setindex", $options, false);
|
||||||
|
$setunique = get_value_in_array("setunique", $options, false);
|
||||||
|
|
||||||
// check if exists table
|
// check if exists table
|
||||||
$bind = array(
|
$bind = array(
|
||||||
|
@ -817,6 +818,12 @@ if(!check_function_exists("exec_db_table_create")) {
|
||||||
$sql = sprintf("create index `%s` on `%s` (%s)", $k, $_tablename, implode(", ", $v));
|
$sql = sprintf("create index `%s` on `%s` (%s)", $k, $_tablename, implode(", ", $v));
|
||||||
exec_db_query($sql);
|
exec_db_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create unique (type of index)
|
||||||
|
foreach($setunique as $k=>$v) {
|
||||||
|
$sql = sprintf("create unique index `%s` on `%s` (%s)", $k, $_tablename, implode(", ", $v));
|
||||||
|
exec_db_query($sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $_tablename;
|
return $_tablename;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user