We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6e04a0 commit 5d24070Copy full SHA for 5d24070
compliance-monitor/sql.py
@@ -169,9 +169,13 @@ def db_get_schema_version(cur: cursor):
169
170
171
def db_set_schema_version(cur: cursor, version: str):
172
- cur.execute('''
173
- UPDATE meta SET value = %s WHERE key = %s
174
- ;''', (version, SCHEMA_VERSION_KEY))
+ cur.execute('''
+ INSERT INTO meta (key, value)
+ VALUES (%s, %s)
175
+ ON CONFLICT (key)
176
+ DO UPDATE
177
+ SET value = EXCLUDED.value
178
+ ;''', (SCHEMA_VERSION_KEY, version))
179
180
181
def db_upgrade_schema(conn: connection, cur: cursor):
0 commit comments