summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-02-13 05:34:10 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-02-13 05:34:10 +0100
commit5b4d53271a841c60e43d64f4b6b3c32794b41ac7 (patch)
tree36118ab77e8e04c72fafa81240facdfa6979c26f
parentd33972bed776a8e95d1e5602534898672eb56cae (diff)
fixes to _create_table() in sqlite_forge.php:
removed space between table name and parenthesis added version check for IF NOT EXISTS
-rw-r--r--system/database/drivers/sqlite/sqlite_forge.php5
-rw-r--r--user_guide/changelog.html1
2 files changed, 4 insertions, 2 deletions
diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php
index e3196cce1..1fd2a2bd4 100644
--- a/system/database/drivers/sqlite/sqlite_forge.php
+++ b/system/database/drivers/sqlite/sqlite_forge.php
@@ -76,12 +76,13 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
{
$sql = 'CREATE TABLE ';
- if ($if_not_exists === TRUE)
+ // IF NOT EXISTS added to SQLite in 3.3.0
+ if ($if_not_exists === TRUE && version_compare($this->_version(), '3.3.0', '>=') === TRUE)
{
$sql .= 'IF NOT EXISTS ';
}
- $sql .= $this->db->_escape_table($table)." (";
+ $sql .= $this->db->_escape_table($table)."(";
$current_field_count = 0;
foreach ($fields as $field=>$attributes)
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 43fac7e72..5279715f0 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -87,6 +87,7 @@ Change Log
<h3>Bugfixes for 1.6.1</h3>
<ul>
<li>Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.</li>
+ <li>Fixed bug (#3379) in DBForge with SQLite for table creation.</li>
<li>Made Active Record fully database prefix aware (#3384)</li>
<li>Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM</li>
<li>Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).</li>