aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-11-15 21:55:32 +0000
committerMatthew Wild <mwild1@gmail.com>2018-11-15 21:55:32 +0000
commit4b9b245dc0ec77a2ee8ca99e5a6ec88e301703a6 (patch)
treedfa5a612e68c55cf9b9671b89d7d5f4bf54ae769 /plugins
parent6580bcad51c16133ae94b1fcd905909f9017b6af (diff)
parent7a66697c6ad8ca48244d2defa578c822e9406632 (diff)
downloadprosody-4b9b245dc0ec77a2ee8ca99e5a6ec88e301703a6.tar.gz
prosody-4b9b245dc0ec77a2ee8ca99e5a6ec88e301703a6.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_sql.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index cf92e31c..56cef569 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -510,12 +510,12 @@ local function upgrade_table(engine, params, apply_changes) -- luacheck: ignore
if params.driver == "MySQL" then
local success,err = engine:transaction(function()
do
- local result = engine:execute("SHOW COLUMNS FROM \"prosody\" WHERE \"Field\"='value' and \"Type\"='text'");
+ local result = assert(engine:execute("SHOW COLUMNS FROM \"prosody\" WHERE \"Field\"='value' and \"Type\"='text'"));
if result:rowcount() > 0 then
changes = true;
if apply_changes then
module:log("info", "Upgrading database schema (value column size)...");
- engine:execute("ALTER TABLE \"prosody\" MODIFY COLUMN \"value\" MEDIUMTEXT");
+ assert(engine:execute("ALTER TABLE \"prosody\" MODIFY COLUMN \"value\" MEDIUMTEXT"));
module:log("info", "Database table automatically upgraded");
end
end
@@ -528,9 +528,9 @@ local function upgrade_table(engine, params, apply_changes) -- luacheck: ignore
changes = true;
if apply_changes then
module:log("info", "Upgrading database schema (prosodyarchive_index)...");
- engine:execute[[ALTER TABLE "prosodyarchive" DROP INDEX prosodyarchive_index;]];
+ assert(engine:execute[[ALTER TABLE "prosodyarchive" DROP INDEX prosodyarchive_index;]]);
local new_index = sql.Index { table = "prosodyarchive", name="prosodyarchive_index", "host", "user", "store", "key" };
- engine:_create_index(new_index);
+ assert(engine:_create_index(new_index));
module:log("info", "Database table automatically upgraded");
end
end