mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 22:03:50 -05:00
Prepare the database whenever a connection is opened from the db_pool so that in-memory databases will work
This commit is contained in:
parent
6375abcdac
commit
183b3d4e47
2 changed files with 7 additions and 10 deletions
|
|
@ -637,10 +637,13 @@ def prepare_database(db_conn):
|
|||
c.executescript(sql_script)
|
||||
|
||||
db_conn.commit()
|
||||
else:
|
||||
logger.info("Database is at version %r", user_version)
|
||||
|
||||
else:
|
||||
sql_script = "BEGIN TRANSACTION;\n"
|
||||
for sql_loc in SCHEMAS:
|
||||
logger.debug("Applying schema %r", sql_loc)
|
||||
sql_script += read_schema(sql_loc)
|
||||
sql_script += "\n"
|
||||
sql_script += "COMMIT TRANSACTION;"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue