summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rhnop-server/playlog.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/rhnop-server/playlog.lua b/rhnop-server/playlog.lua
index d6f1987..97ee4cf 100644
--- a/rhnop-server/playlog.lua
+++ b/rhnop-server/playlog.lua
@@ -21,11 +21,12 @@
luasql = require "luasql.mysql"
--- CREATE DATABASE rhnop
+-- CREATE DATABASE rhnop CHARACTER SET utf8 COLLATE utf8_unicode_ci;
-- GRANT select,insert,update ON rhnop.* TO 'nopsyncd' IDENTIFIED BY '<password>';
-- GRANT select ON rhnop.* TO 'nopcollectd' IDENTIFIED BY '<password>';
-- USE rhnop
-- CREATE TABLE IF NOT EXISTS now (timestamp BIGINT UNSIGNED PRIMARY KEY NOT NULL, cart INT NOT NULL, len INT, showtitle VARCHAR(255), title VARCHAR(255), artist VARCHAR(255), album VARCHAR(255), ismusic BOOLEAN);
+-- ALTER TABLE now CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
conf = require "conf"
@@ -44,7 +45,12 @@ function playlog:init()
return nil, err
end
- local ret, err = self.con:setautocommit(true)
+ local ret, err = self.con:execute("SET CHARACTER SET utf8")
+ if ret == nil then
+ return nil, err
+ end
+
+ ret, err = self.con:setautocommit(true)
if ret == nil then
return nil, err
end