summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8/oci8_forge.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/oci8/oci8_forge.php')
-rw-r--r--system/database/drivers/oci8/oci8_forge.php50
1 files changed, 44 insertions, 6 deletions
diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php
index 80100977a..867a94341 100644
--- a/system/database/drivers/oci8/oci8_forge.php
+++ b/system/database/drivers/oci8/oci8_forge.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2017, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.4.1
* @filesource
*/
@@ -42,7 +42,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*
* @category Database
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/database/
+ * @link https://codeigniter.com/user_guide/database/
*/
class CI_DB_oci8_forge extends CI_DB_forge {
@@ -54,6 +54,13 @@ class CI_DB_oci8_forge extends CI_DB_forge {
protected $_create_database = FALSE;
/**
+ * CREATE TABLE IF statement
+ *
+ * @var string
+ */
+ protected $_create_table_if = FALSE;
+
+ /**
* DROP DATABASE statement
*
* @var string
@@ -119,6 +126,8 @@ class CI_DB_oci8_forge extends CI_DB_forge {
$sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' '.$this->db->escape_identifiers($field[$i]['new_name']);
}
+
+ $field[$i] = "\n\t".$field[$i]['_literal'];
}
}
@@ -129,7 +138,7 @@ class CI_DB_oci8_forge extends CI_DB_forge {
// RENAME COLUMN must be executed after MODIFY
array_unshift($sqls, $sql);
- return $sql;
+ return $sqls;
}
// --------------------------------------------------------------------
@@ -146,4 +155,33 @@ class CI_DB_oci8_forge extends CI_DB_forge {
// Not supported - sequences and triggers must be used instead
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Field attribute TYPE
+ *
+ * Performs a data type mapping between different databases.
+ *
+ * @param array &$attributes
+ * @return void
+ */
+ protected function _attr_type(&$attributes)
+ {
+ switch (strtoupper($attributes['TYPE']))
+ {
+ case 'TINYINT':
+ $attributes['TYPE'] = 'NUMBER';
+ return;
+ case 'MEDIUMINT':
+ $attributes['TYPE'] = 'NUMBER';
+ return;
+ case 'INT':
+ $attributes['TYPE'] = 'NUMBER';
+ return;
+ case 'BIGINT':
+ $attributes['TYPE'] = 'NUMBER';
+ return;
+ default: return;
+ }
+ }
}