summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorytetsuro <phper.0o0@gmail.com>2019-10-28 05:47:43 +0100
committerytetsuro <phper.0o0@gmail.com>2019-10-28 05:47:43 +0100
commit187c8833635f67c5891e3fb365561f82d5a50dc2 (patch)
tree6a5374632e1c15ce8f5579e24f7913d233c7f7b9 /system/database
parent8887b3e684aef0121ba75e1fd9d4cc764167648a (diff)
feat: Modified to useable auto increment.
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_oci_forge.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php b/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
index b5d3eb143..aa78461df 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
@@ -150,9 +150,33 @@ class CI_DB_pdo_oci_forge extends CI_DB_pdo_forge {
*/
protected function _attr_auto_increment(&$attributes, &$field)
{
- // Not supported - sequences and triggers must be used instead
+ if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE && stripos($field['type'], 'number') !== FALSE && version_compare($this->db->version(), '12.1', '>='))
+ {
+ $field['auto_increment'] = ' GENERATED ALWAYS AS IDENTITY';
+ }
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Process column
+ *
+ * @param array $field
+ * @return string
+ */
+ protected function _process_column($field)
+ {
+ return $this->db->escape_identifiers($field['name'])
+ .' '.$field['type'].$field['length']
+ .$field['unsigned']
+ .$field['default']
+ .$field['auto_increment']
+ .$field['null']
+ .$field['unique'];
}
+ // --------------------------------------------------------------------
+
/**
* Field attribute TYPE
*