From d44af37e883b373cac255b4881ad3eb040c85e86 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 25 Nov 2019 11:41:53 +0200 Subject: [ci skip] Merge pull request #5856 from ytetsuro/fix/oracle12.1-support-auto-increment Enhancement oracle dbforge, auto_increment can be used when using oracle 12.1. --- system/database/drivers/oci8/oci8_forge.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/oci8/oci8_forge.php') diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 58f3c3913..a73899888 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -159,7 +159,29 @@ class CI_DB_oci8_forge extends CI_DB_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']; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 3de79e995faf021fab70b6a82ec57e9fdb0dbedb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 9 Jul 2020 11:33:52 +0300 Subject: [ci skip] Merge pull request #5970 from sapics/fix/user-guide-url Fix user guide url --- system/database/drivers/oci8/oci8_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/oci8/oci8_forge.php') diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index a73899888..7dc7b2ade 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -42,7 +42,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * * @category Database * @author EllisLab Dev Team - * @link https://codeigniter.com/user_guide/database/ + * @link https://codeigniter.com/userguide3/database/ */ class CI_DB_oci8_forge extends CI_DB_forge { -- cgit v1.2.3-24-g4f1b