Mercurial > prosody-modules
changeset 2408:9d132153d786
mod_log_messages: Add assert() to detect errors creating SQL table
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 02 Dec 2016 20:47:11 +0000 |
parents | be08b65f2855 |
children | b426f1d46938 |
files | mod_log_messages_sql/mod_log_messages_sql.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_log_messages_sql/mod_log_messages_sql.lua Fri Dec 02 19:06:37 2016 +0000 +++ b/mod_log_messages_sql/mod_log_messages_sql.lua Fri Dec 02 20:47:11 2016 +0000 @@ -169,7 +169,7 @@ -- In the telnet console, run: -- >hosts["this host"].modules.mam_sql.environment.create_sql() function create_sql() - local stm = getsql([[ + local stm = assert(getsql([[ CREATE TABLE `]]..table_name..[[` ( `host` TEXT, `user` TEXT, @@ -183,7 +183,7 @@ CREATE INDEX `hus` ON `]]..table_name..[[` (`host`, `user`, `store`); CREATE INDEX `with` ON `]]..table_name..[[` (`with`); CREATE INDEX `thetime` ON `]]..table_name..[[` (`when`); - ]]); + ]])); stm:execute(); sql.commit(); end