Skip to content

Commit

Permalink
fix issue when resuming migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
eloyfelix committed Feb 23, 2023
1 parent d4c3ea8 commit a40e9cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions cbl_migrator/migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ def fill_table(o_eng_conn, d_eng_conn, table, chunk_size):
)
return True
elif count != d_count and d_count != 0:
q = select(table).order_by(dpk.desc()).limit(1)
q = select(dpk).order_by(dpk.desc()).limit(1)
with d_eng.connect() as conn:
res = conn.execute(q)
last_id = res.first().__getitem__(dpk.name)
last_id = conn.scalar(q)
first_it = False

# table has a composite pk (usualy a bad design choice).
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
if __name__ == "__main__":
setup(
name="cbl_migrator",
version="0.3.5",
version="0.3.6",
author="Eloy Félix",
author_email="[email protected]",
author_email="[email protected]",
description="Migrates Oracle dbs to PostgreSQL, MySQL and SQLite",
url="https://github.com/chembl/cbl_migrator",
license="MIT",
Expand Down

0 comments on commit a40e9cf

Please sign in to comment.