Software /
code /
prosody
Comparison
plugins/mod_storage_sql2.lua @ 5711:254a9420e53d
mod_storage_sql2: Use correct variable (Thanks SkyBlue and Florob)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 23 Jun 2013 19:27:49 +0200 |
parent | 5494:9916f0a2d178 |
child | 5732:4aa1d6f5083a |
comparison
equal
deleted
inserted
replaced
5703:ea00fc524b95 | 5711:254a9420e53d |
---|---|
83 local n_bad_columns = result:rowcount(); | 83 local n_bad_columns = result:rowcount(); |
84 if n_bad_columns > 0 then | 84 if n_bad_columns > 0 then |
85 module:log("warn", "Found %d columns in prosody table requiring encoding change, updating now...", n_bad_columns); | 85 module:log("warn", "Found %d columns in prosody table requiring encoding change, updating now...", n_bad_columns); |
86 local fix_column_query1 = "ALTER TABLE `prosody` CHANGE `%s` `%s` BLOB;"; | 86 local fix_column_query1 = "ALTER TABLE `prosody` CHANGE `%s` `%s` BLOB;"; |
87 local fix_column_query2 = "ALTER TABLE `prosody` CHANGE `%s` `%s` %s CHARACTER SET 'utf8' COLLATE 'utf8_bin';"; | 87 local fix_column_query2 = "ALTER TABLE `prosody` CHANGE `%s` `%s` %s CHARACTER SET 'utf8' COLLATE 'utf8_bin';"; |
88 for row in success:rows() do | 88 for row in result:rows() do |
89 local column_name, column_type = unpack(row); | 89 local column_name, column_type = unpack(row); |
90 engine:execute(fix_column_query1:format(column_name, column_name)); | 90 engine:execute(fix_column_query1:format(column_name, column_name)); |
91 engine:execute(fix_column_query2:format(column_name, column_name, column_type)); | 91 engine:execute(fix_column_query2:format(column_name, column_name, column_type)); |
92 end | 92 end |
93 module:log("info", "Database encoding upgrade complete!"); | 93 module:log("info", "Database encoding upgrade complete!"); |