summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/build/changelog/changelog_12.rst17
-rw-r--r--doc/build/changelog/migration_12.rst33
2 files changed, 50 insertions, 0 deletions
diff --git a/doc/build/changelog/changelog_12.rst b/doc/build/changelog/changelog_12.rst
index 009f5b974..83df9167f 100644
--- a/doc/build/changelog/changelog_12.rst
+++ b/doc/build/changelog/changelog_12.rst
@@ -12,3 +12,20 @@
.. changelog::
:version: 1.2.0b1
+
+
+ .. change:: 3276
+ :tags: bug, oracle
+ :tickets: 3276
+
+ Oracle reflection now "normalizes" the name given to a foreign key
+ constraint, that is, returns it as all lower case for a case
+ insensitive name. This was already the behavior for indexes
+ and primary key constraints as well as all table and column names.
+ This will allow Alembic autogenerate scripts to compare and render
+ foreign key constraint names correctly when initially specified
+ as case insensitive.
+
+ .. seealso::
+
+ :ref:`change_3276` \ No newline at end of file
diff --git a/doc/build/changelog/migration_12.rst b/doc/build/changelog/migration_12.rst
index 204652264..095048228 100644
--- a/doc/build/changelog/migration_12.rst
+++ b/doc/build/changelog/migration_12.rst
@@ -55,3 +55,36 @@ Dialect Improvements and Changes - SQLite
Dialect Improvements and Changes - Oracle
=============================================
+.. _change_3276:
+
+Oracle foreign key constraint names are now "name normalized"
+-------------------------------------------------------------
+
+The names of foreign key constraints as delivered to a
+:class:`.ForeignKeyConstraint` object during table reflection as well as
+within the :meth:`.Inspector.get_foreign_keys` method will now be
+"name normalized", that is, expressed as lower case for a case insensitive
+name, rather than the raw UPPERCASE format that Oracle uses::
+
+ >>> insp.get_indexes("addresses")
+ [{'unique': False, 'column_names': [u'user_id'],
+ 'name': u'address_idx', 'dialect_options': {}}]
+
+ >>> insp.get_pk_constraint("addresses")
+ {'name': u'pk_cons', 'constrained_columns': [u'id']}
+
+ >>> insp.get_foreign_keys("addresses")
+ [{'referred_table': u'users', 'referred_columns': [u'id'],
+ 'referred_schema': None, 'name': u'user_id_fk',
+ 'constrained_columns': [u'user_id']}]
+
+Previously, the foreign keys result would look like::
+
+ [{'referred_table': u'users', 'referred_columns': [u'id'],
+ 'referred_schema': None, 'name': 'USER_ID_FK',
+ 'constrained_columns': [u'user_id']}]
+
+Where the above could create problems particularly with Alembic autogenerate.
+
+:ticket:`3276`
+