diff options
author | Erik Johnston <erik@matrix.org> | 2015-04-02 10:06:22 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-04-02 10:06:22 +0100 |
commit | 779f7b0f443bfab351702161763b62b7bb6a27d8 (patch) | |
tree | 43729d7eb2030bf124ca0d8fa742ffa056bdb79f /synapse/app | |
parent | Fix SQLite support (diff) | |
download | synapse-779f7b0f443bfab351702161763b62b7bb6a27d8.tar.xz |
Fix unicode support
Diffstat (limited to 'synapse/app')
-rwxr-xr-x | synapse/app/homeserver.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 1ab6effd5f..9d7a58080d 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -18,7 +18,7 @@ import sys sys.dont_write_bytecode = True from synapse.storage import ( - prepare_database, prepare_sqlite3_database, UpgradeDatabaseException, + prepare_database, UpgradeDatabaseException, ) from synapse.storage.engines import create_engine @@ -381,19 +381,18 @@ def setup(config_options): "sql_mode": "TRADITIONAL", "charset": "utf8mb4", "use_unicode": True, + "collation": "utf8mb4_general_ci", }) elif name == "sqlite3": - def open_fun(conn): - prepare_database(conn, database_engine) db_config.setdefault("args", {}).update({ "cp_min": 1, "cp_max": 1, - "cp_openfun": open_fun, }) else: raise RuntimeError("Unsupported database type '%s'" % (name,)) database_engine = create_engine(name) + db_config["args"]["cp_openfun"] = database_engine.on_new_connection hs = SynapseHomeServer( config.server_name, @@ -424,10 +423,7 @@ def setup(config_options): } ) - if name == "sqlite3": - prepare_sqlite3_database(db_conn) - - prepare_database(db_conn, database_engine) + database_engine.prepare_database(db_conn) db_conn.commit() except UpgradeDatabaseException: |