Add latest openbsd and alpine support

This commit is contained in:
j3s
2020-10-29 21:25:29 -05:00
parent f02974eb5a
commit cd92e8486d
3 changed files with 70 additions and 5 deletions

View File

@ -14,7 +14,7 @@ def init_app(app):
databaseUrl = urlparse(app.config['DATABASE_URL'])
app.config['PSYCOPG2_CONNECTION_POOL'] = psycopg2.pool.SimpleConnectionPool(
1,
1,
20,
user = databaseUrl.username,
password = databaseUrl.password,
@ -34,13 +34,13 @@ def init_app(app):
key = result.group()
with open(join(schemaMigrationsPath, filename), 'rb') as file:
schemaMigrations[key] = file.read().decode("utf8")
connection = app.config['PSYCOPG2_CONNECTION_POOL'].getconn()
hasSchemaVersionTable = False
actionWasTaken = False
schemaVersion = 0
desiredSchemaVersion = 7
desiredSchemaVersion = 8
cursor = connection.cursor()
@ -95,11 +95,11 @@ def init_app(app):
if schemaVersion != versionFromDatabase:
app.logger.critical("incorrect schema version value \"{}\" after running migration {}, expected \"{}\". exiting.".format(
versionFromDatabase,
migrationKey,
migrationKey,
schemaVersion
))
exit(1)
cursor.close()
app.config['PSYCOPG2_CONNECTION_POOL'].putconn(connection)