From d226faddbfe6e83059c7d1f39313db5c85d8ad07 Mon Sep 17 00:00:00 2001 From: Charlie Duso Date: Wed, 29 Jun 2016 21:55:27 -0700 Subject: [PATCH] Added loop to merge databases. Need to do a few more tests, but should be finalized. --- mergeScript.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mergeScript.py b/mergeScript.py index 53c4101..7459337 100644 --- a/mergeScript.py +++ b/mergeScript.py @@ -120,7 +120,7 @@ mainDB = 'testDB_1.db' # This is where the main database is # referenced. Where all items will be # merged to. -otherDBs = ['testDB_2.db'] # This is the list of the other databases. +otherDBs = ['testDB_2.db'] # This is the list of the other databases. if (len(otherDBs) == 0): print("ERROR: No databases have been added for merging.") sys.exit() @@ -179,8 +179,10 @@ for i in range(0, len(otherDBs)): # Merge databases -#for i in range(0, len(listDB)): - +for i in range(0, len(listDB)): + for j in range(0, len(listTable)): + columns = listToString(getColumnNames(listTable[j])) # get columns + mergeTable(listTable[j], columns, listDB[i]) conn.commit() # Commit changes