Software /
code /
prosody
Diff
util/sql.lua @ 5739:2e9ad9cb206f
util.sql: Set charset and collation for MySQL when creating tables
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 11 Jul 2013 22:07:55 +0200 |
parent | 5494:9916f0a2d178 |
child | 5742:3c57c2281087 |
line wrap: on
line diff
--- a/util/sql.lua Thu Jul 11 15:13:45 2013 +0100 +++ b/util/sql.lua Thu Jul 11 22:07:55 2013 +0200 @@ -264,6 +264,8 @@ 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