forked from 3wordchant/capsul-flask
Add latest openbsd and alpine support
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user