[AB-xxx] fixing deployment of zip artifacts named the same name being deployed twice

This commit is contained in:
Sheldan
2021-04-05 01:11:45 +02:00
parent ecc81884e6
commit df1a0cfc02
2 changed files with 11 additions and 7 deletions

View File

@@ -23,7 +23,8 @@ def deploy_template_folder(db_config, folder):
print('Deploying %s templates from folder %s' % (len(templates), folder))
with engine.connect() as con:
statement = text("""INSERT INTO template(key, content, last_modified) VALUES(:key, :content, NOW()) ON CONFLICT (key) DO UPDATE SET content = :content""")
with con.begin():
statement = text("""INSERT INTO template(key, content, last_modified) VALUES(:key, :content, NOW()) ON CONFLICT (key) DO UPDATE SET content = :content""")
for line in templates:
con.execute(statement, **line)
for line in templates:
con.execute(statement, **line)