From 5b4d53271a841c60e43d64f4b6b3c32794b41ac7 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 13 Feb 2008 04:34:10 +0000 Subject: fixes to _create_table() in sqlite_forge.php: removed space between table name and parenthesis added version check for IF NOT EXISTS --- system/database/drivers/sqlite/sqlite_forge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/sqlite') 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) -- cgit v1.2.3-24-g4f1b