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
Collaborator

@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 Oct 23, 2015
@jklukas jklukas force-pushed the reflection-fix branch from 931d062 to 559d3f8 Oct 31, 2015
@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())

This comment has been minimized.

@jklukas

jklukas Oct 31, 2015
Author Collaborator

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
Collaborator

@graingert graingert commented Nov 2, 2015

nice, merge this when you're ready

@jklukas jklukas force-pushed the reflection-fix branch from 559d3f8 to 77ea92a Nov 2, 2015
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
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@jklukas jklukas deleted the reflection-fix branch May 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.