Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

do not reference a modified row before it's modified

  • Loading branch information...
commit 3f8e1f005b20291a825b8e0ddb0139cafa7bb8b0 1 parent 022a4a5
Mitch Matuson authored
Showing with 9 additions and 10 deletions.
  1. +9 −10 schemasync/syncdb.py
View
19 schemasync/syncdb.py
@@ -66,16 +66,6 @@ def sync_table(from_table, to_table, options):
Yields:
A tuple (patch, revert) containing the next SQL statements
"""
- for p, r in sync_created_columns(from_table.columns,
- to_table.columns,
- sync_comments=options['sync_comments']):
- yield (p, r)
-
- for p, r in sync_dropped_columns(from_table.columns,
- to_table.columns,
- sync_comments=options['sync_comments']):
- yield (p, r)
-
if from_table and to_table:
for p, r in sync_modified_columns(from_table.columns,
to_table.columns,
@@ -115,6 +105,15 @@ def sync_table(from_table, to_table, options):
if p:
yield (p, r)
+ for p, r in sync_created_columns(from_table.columns,
+ to_table.columns,
+ sync_comments=options['sync_comments']):
+ yield (p, r)
+
+ for p, r in sync_dropped_columns(from_table.columns,
+ to_table.columns,
+ sync_comments=options['sync_comments']):
+ yield (p, r)
def sync_database_options(from_db, to_db):
"""Generate the SQL statements needed to modify the Database options

2 comments on commit 3f8e1f0

@SkaveRat

This commit works as expected. MODIFY statements are now in front of add/drop statements.

@mmatuson
Owner

Thank you for helping test this fix.

Please sign in to comment.
Something went wrong with that request. Please try again.