mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:47:07 +00:00
Reset event serial ids after re-import.
When the database is recreated, the sequences used in the events_timed and events_seq tables will be at their initial values, which will almost certainly conflict with existing data when it is imported via COPY. With this commit, we set the current value for those sequences to something usable. Fixes #33.
This commit is contained in:
@@ -46,5 +46,7 @@ if __name__ == '__main__':
|
||||
|
||||
# If we don't commit the data does not actually get copied
|
||||
db.conn.commit()
|
||||
# Update the sequences that generate event ids
|
||||
cur.execute("SELECT reset_events_serials();")
|
||||
|
||||
print("Done")
|
||||
|
||||
Reference in New Issue
Block a user