From 567d00c04590e8db5553b567f8317ff455ab7f93 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 11 Jul 2013 22:07:55 +0200 Subject: util.sql: Set charset and collation for MySQL when creating tables --- util/sql.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/sql.lua b/util/sql.lua index f360d6d0..771df7aa 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -264,6 +264,8 @@ function engine:_create_table(table) sql = sql.. ");" if self.params.driver == "PostgreSQL" then sql = sql:gsub("`", "\""); + elseif self.params.driver == "MySQL" then + sql = sql:gsub(";$", " CHARACTER SET 'utf8' COLLATE 'utf8_bin';"); end local success,err = self:execute(sql); if not success then return success,err; end -- cgit v1.2.3