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

Projects
None yet
2 participants
@jklukas
Collaborator

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 changed the title from BUG: Sort by attnum to ensure reflected column ordering to 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

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).

@jklukas

jklukas Oct 31, 2015

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

This comment has been minimized.

Show comment
Hide comment
@graingert

graingert Nov 2, 2015

Collaborator

nice, merge this when you're ready

Collaborator

graingert commented Nov 2, 2015

nice, merge this when you're ready

jklukas added a commit that referenced this pull request Nov 2, 2015

Merge pull request #60 from sqlalchemy-redshift/reflection-fix
Order columns by attnum to ensure proper ordering in reflected table

@jklukas jklukas merged commit 64107a5 into master Nov 2, 2015

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