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",