mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-10 21:26:35 +01:00
Fixed locate mysql function and varchar definition in sql library.
This commit is contained in:
parent
22a5ddc115
commit
373c281111
@ -20,7 +20,7 @@ class sql_conversions {
|
||||
|
||||
"find" => array(
|
||||
|
||||
"mysql" => "LOCATE( %string%, %substring% )",
|
||||
"mysql" => "LOCATE( %substring%, %string% )",
|
||||
"pgsql" => "POSITION( %substring% in %string% )",
|
||||
"sqlite" => "INSTR( %string%, %substring% )",
|
||||
),
|
||||
@ -103,7 +103,7 @@ class sql_conversions {
|
||||
|
||||
"string" => array(
|
||||
|
||||
"mysql" => "VARCHAR",
|
||||
"mysql" => "VARCHAR(255)",
|
||||
"pgsql" => "VARCHAR",
|
||||
"sqlite" => "VARCHAR",
|
||||
),
|
||||
@ -393,7 +393,13 @@ class sql_conversions {
|
||||
|
||||
$unique_string = $this->specials["unique"][$dbtype] . ",";
|
||||
}
|
||||
$fields_string .= "{$id_open}{$id}{$id_close},";
|
||||
if( $dbtype == "mysql" && $fields[$id] == "text" ) {
|
||||
|
||||
$fields_string .= "{$id_open}{$id}{$id_close}(1024),";
|
||||
} else {
|
||||
|
||||
$fields_string .= "{$id_open}{$id}{$id_close},";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -412,7 +418,7 @@ class sql_conversions {
|
||||
|
||||
foreach( $tables as $table_name => $table_data ) {
|
||||
|
||||
$query .= $this->table( $table_name, $table_data["fields"], $table_data["attributes"] );
|
||||
$query .= $this->table( $table_name, $table_data["fields"], $table_data["attributes"] ) . PHP_EOL;
|
||||
}
|
||||
return( $query );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user