mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-19 11:44:38 -04:00
Add support for postgres instead of mysql. Change sql accourdingly. blob + varbinary -> bytea. No support for UNSIGNED or CREATE INDEX IF NOT EXISTS.
This commit is contained in:
parent
3c741682e5
commit
58d8339966
21 changed files with 153 additions and 140 deletions
|
@ -236,7 +236,7 @@ def _setup_new_database(cur, database_engine):
|
|||
|
||||
cur.execute(
|
||||
database_engine.convert_param_style(
|
||||
"REPLACE INTO schema_version (version, upgraded)"
|
||||
"INSERT INTO schema_version (version, upgraded)"
|
||||
" VALUES (?,?)"
|
||||
),
|
||||
(max_current_ver, False,)
|
||||
|
@ -432,14 +432,11 @@ def executescript(txn, schema_path):
|
|||
|
||||
|
||||
def _get_or_create_schema_state(txn, database_engine):
|
||||
try:
|
||||
# Bluntly try creating the schema_version tables.
|
||||
schema_path = os.path.join(
|
||||
dir_path, "schema", "schema_version.sql",
|
||||
)
|
||||
executescript(txn, schema_path)
|
||||
except:
|
||||
pass
|
||||
# Bluntly try creating the schema_version tables.
|
||||
schema_path = os.path.join(
|
||||
dir_path, "schema", "schema_version.sql",
|
||||
)
|
||||
executescript(txn, schema_path)
|
||||
|
||||
txn.execute("SELECT version, upgraded FROM schema_version")
|
||||
row = txn.fetchone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue