summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlsrv/sqlsrv_forge.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-09 15:16:16 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-09 15:16:16 +0200
commita58c0b695a0590aff07a42ad2ad81b544e226af9 (patch)
tree52eb2c2c56e846f6dbd0c4ab2c516db7642cf86a /system/database/drivers/sqlsrv/sqlsrv_forge.php
parent89ba83c811338134030ef051626e38e3876bc762 (diff)
parentb457a4001ce2380e97f36b0a983b477c3e31de69 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/sqlsrv/sqlsrv_forge.php')
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_forge.php60
1 files changed, 3 insertions, 57 deletions
diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php
index 626cf52d5..b6e97ab0e 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_forge.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php
@@ -34,44 +34,7 @@
*/
class CI_DB_sqlsrv_forge extends CI_DB_forge {
- /**
- * Create database
- *
- * @param string the database name
- * @return string
- */
- public function _create_database($name)
- {
- return 'CREATE DATABASE '.$name;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Drop database
- *
- * @param string the database name
- * @return string
- */
- public function _drop_database($name)
- {
- return 'DROP DATABASE '.$name;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Drop Table
- *
- * @param string table name
- * @return string
- */
- public function _drop_table($table)
- {
- return 'DROP TABLE '.$this->db->escape_identifiers($table);
- }
-
- // --------------------------------------------------------------------
+ protected $_drop_table = 'DROP TABLE %s';
/**
* Create Table
@@ -83,7 +46,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge {
* @param bool should 'IF NOT EXISTS' be added to the SQL
* @return string
*/
- public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
+ protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
{
$sql = 'CREATE TABLE ';
@@ -166,7 +129,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge {
* @param string the field after which we should add the new field
* @return string
*/
- public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
+ protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
{
$sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name);
@@ -182,23 +145,6 @@ class CI_DB_sqlsrv_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)
- {
- // I think this syntax will work, but can find little documentation on renaming tables in MSSQL
- return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name);
- }
-
}
/* End of file sqlsrv_forge.php */