diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-04-09 13:58:28 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-04-09 13:58:28 +0200 |
commit | d947eba0bdaf9d86401fdcba9e97706905cacf9d (patch) | |
tree | 457928871f3d4622012dcbaac9260a2489b15c2d /system/database/drivers/mysqli | |
parent | a254836a611e8f555ea4bbc84e500c7040ebae4e (diff) |
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
Diffstat (limited to 'system/database/drivers/mysqli')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_forge.php | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 4b6939e2a..c0a411c97 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -34,31 +34,7 @@ */ class CI_DB_mysqli_forge extends CI_DB_forge { - /** - * Create database - * - * @param string the database name - * @return string - */ - public function _create_database($name) - { - return 'CREATE DATABASE '.$name.' CHARACTER SET '.$this->db->char_set.' COLLATE '.$this->db->dbcollat; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @param string the database name - * @return string - */ - public function _drop_database($name) - { - return 'DROP DATABASE '.$name; - } - - // -------------------------------------------------------------------- + protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s'; /** * Process Fields @@ -181,18 +157,6 @@ class CI_DB_mysqli_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 * * Generates a platform-specific query so that a table can be altered @@ -218,22 +182,6 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .($after_field != '' ? ' AFTER '.$this->db->protect_identifiers($after_field) : ''); } - // -------------------------------------------------------------------- - - /** - * 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 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); - } - } /* End of file mysqli_forge.php */ |