Create the table using AUTOINCREMENT. Before you add the first tuple set the sqlite_sequence table to the "start value" for that instance. After you combine the tables, DO NOT INSERT ANY MORE ROWS (that is, keep the instance databases isolated from each other). <https://sqlite.org/autoinc.html>