mod_storage_sql: Keep prosodyarchive_index unique constraint on non-MySQL DBs
authorMatthew Wild <mwild1@gmail.com>
Fri, 12 Oct 2018 21:59:15 +0100
changeset 9503 7de89d66cbb9
parent 9502 36e379f058c8
child 9504 8715961bfa13
mod_storage_sql: Keep prosodyarchive_index unique constraint on non-MySQL DBs
plugins/mod_storage_sql.lua
--- a/plugins/mod_storage_sql.lua	Fri Oct 12 17:36:34 2018 +0200
+++ b/plugins/mod_storage_sql.lua	Fri Oct 12 21:59:15 2018 +0100
@@ -496,7 +496,7 @@
 		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" };
 	};