aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-12 21:59:15 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-12 21:59:15 +0100
commit7679825f30333c7ee10aa2c68bde3dd69a21609d (patch)
tree3392a3a52aa7911b1f5f21d1cf060cfd77bab236
parentf9ffb571e387e6d16adda1e74e91cc78da8b0cc0 (diff)
downloadprosody-7679825f30333c7ee10aa2c68bde3dd69a21609d.tar.gz
prosody-7679825f30333c7ee10aa2c68bde3dd69a21609d.zip
mod_storage_sql: Keep prosodyarchive_index unique constraint on non-MySQL DBs
-rw-r--r--plugins/mod_storage_sql.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 872b5f49..859b43c9 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -496,7 +496,7 @@ local function create_table(engine) -- luacheck: ignore 431/engine
Column { name="with", type="TEXT", nullable=false }; -- related id
Column { name="type", type="TEXT", nullable=false };
Column { name="value", type="MEDIUMTEXT", nullable=false };
- Index { name="prosodyarchive_index", "host", "user", "store", "key" };
+ Index { name="prosodyarchive_index", unique = engine.params.driver ~= "MySQL", "host", "user", "store", "key" };
Index { name="prosodyarchive_with_when", "host", "user", "store", "with", "when" };
Index { name="prosodyarchive_when", "host", "user", "store", "when" };
};