summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8/oci8_forge.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-02 12:08:09 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-02 12:08:09 +0100
commit62d6ee48b319dc7ec92b4a14fa8dbd3601060544 (patch)
treed8d375ebdee8a6737deb10d83892ce87d14e7bdb /system/database/drivers/oci8/oci8_forge.php
parent376ac97d5581c23c88ad3cbbce39f3515ff5fd06 (diff)
parent8f22057724dd8fe2b9d41ba98bfc4da282572c5e (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/oci8/oci8_forge.php')
-rw-r--r--system/database/drivers/oci8/oci8_forge.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php
index 1dcc346d2..fe8317d0e 100644
--- a/system/database/drivers/oci8/oci8_forge.php
+++ b/system/database/drivers/oci8/oci8_forge.php
@@ -84,7 +84,7 @@ class CI_DB_oci8_forge extends CI_DB_forge {
$sql .= $this->db->_escape_identifiers($table).' (';
$current_field_count = 0;
- foreach ($fields as $field=>$attributes)
+ foreach ($fields as $field => $attributes)
{
// Numeric field names aren't allowed in databases, so if the key is
// numeric, we know it was assigned by PHP and the developer manually
@@ -98,10 +98,10 @@ class CI_DB_oci8_forge extends CI_DB_forge {
$attributes = array_change_key_case($attributes, CASE_UPPER);
$sql .= "\n\t".$this->db->protect_identifiers($field).' '.$attributes['TYPE']
- .(isset($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
- .((isset($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
- .(isset($attributes['DEFAULT']) ? ' DEFAULT \''.$attributes['DEFAULT'].'\'' : '')
- .((isset($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL');
+ .((isset($attributes['UNSINGED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
+ .(isset($attributes['DEFAULT']) ? " DEFAULT '".$attributes['DEFAULT']."'" : '')
+ .((isset($attributes['NULL']) && $attributes['NULL'] === TRUE) ? '' : ' NOT NULL')
+ .(isset($attributes['CONSTRAINT']) ? ' CONSTRAINT '.$attributes['CONSTRAINT'] : '');
}
// don't add a comma on the end of the last field
@@ -114,7 +114,7 @@ class CI_DB_oci8_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
$primary_keys = $this->db->protect_identifiers($primary_keys);
- $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).')';
+ $sql .= ",\n\tCONSTRAINT ".$table.' PRIMARY KEY ('.implode(', ', $primary_keys).')';
}
if (is_array($keys) && count($keys) > 0)