summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/postgre/postgre_forge.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-09 15:18:24 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-09 15:18:24 +0200
commit697bf3ff1fe859968532d8dcc1e1cf7ecb55ca73 (patch)
tree49fe1fafd8a71f8b854050b1e236c00e44719e3e /system/database/drivers/postgre/postgre_forge.php
parent82e88b9b3031163d2f86f8e53450c1d779a08d8f (diff)
parentb457a4001ce2380e97f36b0a983b477c3e31de69 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/postgre/postgre_forge.php')
-rw-r--r--system/database/drivers/postgre/postgre_forge.php59
1 files changed, 3 insertions, 56 deletions
diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php
index 0662ce9e8..94c97af50 100644
--- a/system/database/drivers/postgre/postgre_forge.php
+++ b/system/database/drivers/postgre/postgre_forge.php
@@ -34,31 +34,7 @@
*/
class CI_DB_postgre_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;
- }
-
- // --------------------------------------------------------------------
+ protected $_drop_table = 'DROP TABLE IF EXISTS %s CASCADE';
/**
* Process Fields
@@ -159,7 +135,7 @@ class CI_DB_postgre_forge extends CI_DB_forge {
* @param bool should 'IF NOT EXISTS' be added to the SQL
* @return bool
*/
- 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 ';
@@ -213,19 +189,6 @@ class CI_DB_postgre_forge extends CI_DB_forge {
// --------------------------------------------------------------------
/**
- * Drop Table
- *
- * @param string table name
- * @return string
- */
- public function _drop_table($table)
- {
- return 'DROP TABLE IF EXISTS '.$this->db->escape_identifiers($table).' CASCADE';
- }
-
- // --------------------------------------------------------------------
-
- /**
* Alter table query
*
* Generates a platform-specific query so that a table can be altered
@@ -240,7 +203,7 @@ class CI_DB_postgre_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, $fields, $after_field = '')
+ protected function _alter_table($alter_type, $table, $fields, $after_field = '')
{
$sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' ';
@@ -254,22 +217,6 @@ class CI_DB_postgre_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 postgre_forge.php */