diff options
author | Mike Bayer <classic@zzzcomputing.com> | 2014-08-07 14:22:31 -0400 |
---|---|---|
committer | Mike Bayer <classic@zzzcomputing.com> | 2014-08-07 14:22:31 -0400 |
commit | 7e762d11d81584f626f0b194b674f72c096fcc26 (patch) | |
tree | e41d629a99e80f6d57badbd30324f41c34280bb9 /alembic/autogenerate | |
parent | c2c28980bbb025f252402274d58bb0c6b4440e03 (diff) | |
parent | 330628c681cc6cad89170d5ead7f9ac4febdbf8e (diff) | |
download | alembic-7e762d11d81584f626f0b194b674f72c096fcc26.tar.gz |
Merged in paradoxxxzero/alembic/paradoxxxzero/fix-sorted-of-none-values-in-compare-for-1403597500844 (pull request #23)
Fix sorted of None values in compare for python 3
Diffstat (limited to 'alembic/autogenerate')
-rw-r--r-- | alembic/autogenerate/compare.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/alembic/autogenerate/compare.py b/alembic/autogenerate/compare.py index 0d58bec..a50bc6d 100644 --- a/alembic/autogenerate/compare.py +++ b/alembic/autogenerate/compare.py @@ -79,7 +79,8 @@ def _compare_tables(conn_table_names, metadata_table_names, inspector.reflecttable(t, None) conn_column_info[(s, tname)] = t - for s, tname in sorted(existing_tables): + for s, tname in sorted(existing_tables, key=lambda x: (x[0] or '', x[1])): + s = s or None name = '%s.%s' % (s, tname) if s else tname metadata_table = tname_to_table[(s, tname)] conn_table = existing_metadata.tables[name] @@ -492,6 +493,3 @@ def _compare_server_default(schema, tname, cname, conn_col, metadata_col, tname, cname ) - - - |