diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-06-20 11:39:01 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-06-20 12:52:31 -0400 |
| commit | bf03d4332ae35e2087b175f8a2e0291d2f4c9aa0 (patch) | |
| tree | 8eadf8feeab0e2a677a8385125251b17bf715b1c /doc/build | |
| parent | 91a1022227499c8efce038c4a0a9bdcdb14a69d0 (diff) | |
| download | sqlalchemy-bf03d4332ae35e2087b175f8a2e0291d2f4c9aa0.tar.gz | |
Don't reorder PrimaryKeyConstraint columns if explicit
Dialed back the "order the primary key columns per auto-increment"
described in :ref:`change_mysql_3216` a bit, so that if the
:class:`.PrimaryKeyConstraint` is explicitly defined, the order
of columns is maintained exactly, allowing control of this behavior
when necessary.
Change-Id: I9e7902c57a96c15968a6abf53e319acf15680da0
Fixes: #3726
Diffstat (limited to 'doc/build')
| -rw-r--r-- | doc/build/changelog/changelog_11.rst | 10 | ||||
| -rw-r--r-- | doc/build/changelog/migration_11.rst | 13 |
2 files changed, 23 insertions, 0 deletions
diff --git a/doc/build/changelog/changelog_11.rst b/doc/build/changelog/changelog_11.rst index abb97229d..44ae8c2bb 100644 --- a/doc/build/changelog/changelog_11.rst +++ b/doc/build/changelog/changelog_11.rst @@ -34,6 +34,16 @@ cases than we expected, which hints that perhaps there are some unknown string-INSERT cases too. + .. change:: + :tags: bug, mysql + :tickets: 3726 + + Dialed back the "order the primary key columns per auto-increment" + described in :ref:`change_mysql_3216` a bit, so that if the + :class:`.PrimaryKeyConstraint` is explicitly defined, the order + of columns is maintained exactly, allowing control of this behavior + when necessary. + .. changelog:: :version: 1.1.0b1 :released: June 16, 2016 diff --git a/doc/build/changelog/migration_11.rst b/doc/build/changelog/migration_11.rst index 9772213ef..4e54b97e1 100644 --- a/doc/build/changelog/migration_11.rst +++ b/doc/build/changelog/migration_11.rst @@ -2397,6 +2397,19 @@ of just stating the AUTO_INCREMENT column *first* within the primary key:: PRIMARY KEY (y, x) )ENGINE=InnoDB +To maintain explicit control of the ordering of primary key columns, +use the :class:`.PrimaryKeyConstraint` construct explicitly (1.1.0b2) +(along with a KEY for the autoincrement column as required by MySQL), e.g.:: + + t = Table( + 'some_table', metadata, + Column('x', Integer, primary_key=True), + Column('y', Integer, primary_key=True, autoincrement=True), + PrimaryKeyConstraint('x', 'y'), + UniqueConstraint('y'), + mysql_engine='InnoDB' + ) + Along with the change :ref:`change_3216`, composite primary keys with or without auto increment are now easier to specify; :paramref:`.Column.autoincrement` |
