From a40e9cf4286c8fc5a9f761f13a0d4a7a3bf9474d Mon Sep 17 00:00:00 2001 From: Eloy Felix Date: Thu, 23 Feb 2023 12:20:37 +0000 Subject: [PATCH] fix issue when resuming migrations --- cbl_migrator/migrator.py | 5 ++--- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cbl_migrator/migrator.py b/cbl_migrator/migrator.py index af47a86..d57e7be 100644 --- a/cbl_migrator/migrator.py +++ b/cbl_migrator/migrator.py @@ -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). diff --git a/setup.py b/setup.py index 7d1094d..3bb83b2 100644 --- a/setup.py +++ b/setup.py @@ -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="eloyfelix@gmail.com", + author_email="efelix@ebi.ac.uk", description="Migrates Oracle dbs to PostgreSQL, MySQL and SQLite", url="https://github.com/chembl/cbl_migrator", license="MIT",