Software /
code /
prosody
Comparison
plugins/mod_storage_sql.lua @ 7757:437fb77e5ded
mod_storage_sql: Normalize parameters for upgrade command
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 01 Dec 2016 10:02:57 +0100 |
parent | 7756:274d0e57cc60 |
child | 7758:2b305ec8c146 |
child | 7847:c430932b8113 |
comparison
equal
deleted
inserted
replaced
7756:274d0e57cc60 | 7757:437fb77e5ded |
---|---|
482 local command = table.remove(arg, 1); | 482 local command = table.remove(arg, 1); |
483 if command == "upgrade" then | 483 if command == "upgrade" then |
484 -- We need to find every unique dburi in the config | 484 -- We need to find every unique dburi in the config |
485 local uris = {}; | 485 local uris = {}; |
486 for host in pairs(prosody.hosts) do | 486 for host in pairs(prosody.hosts) do |
487 local params = config.get(host, "sql") or default_params; | 487 local params = normalize_params(config.get(host, "sql") or default_params); |
488 uris[sql.db2uri(params)] = params; | 488 uris[sql.db2uri(params)] = params; |
489 end | 489 end |
490 print("We will check and upgrade the following databases:\n"); | 490 print("We will check and upgrade the following databases:\n"); |
491 for _, params in pairs(uris) do | 491 for _, params in pairs(uris) do |
492 print("", "["..params.driver.."] "..params.database..(params.host and " on "..params.host or "")); | 492 print("", "["..params.driver.."] "..params.database..(params.host and " on "..params.host or "")); |