summary refs log tree commit diff
path: root/synapse/storage/engines/maria.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-02 10:06:22 +0100
committerErik Johnston <erik@matrix.org>2015-04-02 10:06:22 +0100
commit779f7b0f443bfab351702161763b62b7bb6a27d8 (patch)
tree43729d7eb2030bf124ca0d8fa742ffa056bdb79f /synapse/storage/engines/maria.py
parentFix SQLite support (diff)
downloadsynapse-779f7b0f443bfab351702161763b62b7bb6a27d8.tar.xz
Fix unicode support
Diffstat (limited to 'synapse/storage/engines/maria.py')
-rw-r--r--synapse/storage/engines/maria.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/engines/maria.py b/synapse/storage/engines/maria.py
index df47763647..7fcb706a60 100644
--- a/synapse/storage/engines/maria.py
+++ b/synapse/storage/engines/maria.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from synapse.storage import prepare_database
 
 import types
 
@@ -28,3 +29,14 @@ class MariaEngine(object):
         if isinstance(param, types.BufferType):
             return str(param)
         return param
+
+    def on_new_connection(self, db_conn):
+        pass
+
+    def prepare_database(self, db_conn):
+        cur = db_conn.cursor()
+        cur.execute(
+            "ALTER DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
+        )
+        db_conn.commit()
+        prepare_database(db_conn, self)