From d947eba0bdaf9d86401fdcba9e97706905cacf9d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 14:58:28 +0300 Subject: Multiple DB Forge improvements - Replaced driver methods _create_database(), _drop_database(), _drop_table() and _rename_table() with properties - Added defaults for the above mentioned platform-specific queries, so that not all drivers need to define them - Improved support for the SQLite, ODBC and PDO drivers --- system/database/drivers/cubrid/cubrid_forge.php | 59 +------------------------ 1 file changed, 2 insertions(+), 57 deletions(-) (limited to 'system/database/drivers/cubrid/cubrid_forge.php') diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index f83dc97f4..fbd449aca 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -34,35 +34,8 @@ */ class CI_DB_cubrid_forge extends CI_DB_forge { - /** - * Create database - * - * @param string the database name - * @return bool - */ - public function _create_database($name) - { - // CUBRID does not allow to create a database in SQL. The GUI tools - // have to be used for this purpose. - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @param string the database name - * @return bool - */ - public function _drop_database($name) - { - // CUBRID does not allow to drop a database in SQL. The GUI tools - // have to be used for this purpose. - return FALSE; - } - - // -------------------------------------------------------------------- + protected $_create_database = FALSE; + protected $_drop_database = FALSE; /** * Process Fields @@ -221,18 +194,6 @@ class CI_DB_cubrid_forge extends CI_DB_forge { // -------------------------------------------------------------------- - /** - * Drop Table - * - * @return string - */ - public function _drop_table($table) - { - return 'DROP TABLE IF EXISTS '.$this->db->escape_identifiers($table); - } - - // -------------------------------------------------------------------- - /** * Alter table query * @@ -265,22 +226,6 @@ class CI_DB_cubrid_forge extends CI_DB_forge { return $sql; } - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @param string the old table name - * @param string the new table name - * @return string - */ - public function _rename_table($table_name, $new_table_name) - { - return 'RENAME TABLE '.$this->db->protect_identifiers($table_name).' AS '.$this->db->protect_identifiers($new_table_name); - } - } /* End of file cubrid_forge.php */ -- cgit v1.2.3-24-g4f1b