Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order columns by attnum to ensure proper ordering in reflected table #60

Merged
merged 1 commit into from
Nov 2, 2015

Conversation

jklukas
Copy link
Member

@jklukas jklukas commented Oct 23, 2015

IDENTITY columns were being put at the end of reflected CREATE TABLE statements, regardless of their actual order in the original table definition.

@jklukas jklukas force-pushed the reflection-fix branch 2 times, most recently from d461db2 to 931d062 Compare October 24, 2015 00:58
@jklukas jklukas changed the title BUG: Sort by attnum to ensure reflected column ordering Order columns by attnum to ensure proper ordering in reflected table Oct 31, 2015
@@ -88,6 +88,7 @@ class ReflectionIdentity(Base):
__tablename__ = 'reflection_identity'
col1 = sa.Column(sa.Integer(), primary_key=True)
col2 = sa.Column(sa.Integer(), info={'identity': (1, 3)})
col3 = sa.Column(sa.Integer())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was only passing before because the IDENTITY column already happened to be the last one. This test now fails under the old code and passes under the new code (where we add attnum to the ORDER BY clause).

@graingert
Copy link
Member

nice, merge this when you're ready

jklukas added a commit that referenced this pull request Nov 2, 2015
Order columns by attnum to ensure proper ordering in reflected table
@jklukas jklukas merged commit 64107a5 into master Nov 2, 2015
@jklukas jklukas deleted the reflection-fix branch May 4, 2017 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants