mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:47:07 +00:00
Suspend trigger during system data import
This commit is contained in:
@@ -31,6 +31,7 @@ if __name__ == '__main__':
|
||||
print(f'Survey: {survey["id"]} ({survey["schema"]})')
|
||||
db.set_survey(survey["schema"])
|
||||
with db.conn.cursor() as cursor:
|
||||
cursor.execute("SET session_replication_role = replica;")
|
||||
|
||||
try:
|
||||
pathPrefix = survey["exports"]["machine"]["path"]
|
||||
@@ -49,6 +50,7 @@ if __name__ == '__main__':
|
||||
|
||||
# If we don't commit the data does not actually get copied
|
||||
db.conn.commit()
|
||||
cursor.execute("SET session_replication_role = DEFAULT;")
|
||||
# Update the sequences that generate event ids
|
||||
cursor.execute("SELECT reset_events_serials();")
|
||||
# Let us ensure events_timed_seq is up to date, even though
|
||||
|
||||
Reference in New Issue
Block a user