Diff

plugins/mod_storage_sql.lua @ 9500:7de89d66cbb9

mod_storage_sql: Keep prosodyarchive_index unique constraint on non-MySQL DBs
author Matthew Wild <mwild1@gmail.com>
date Fri, 12 Oct 2018 21:59:15 +0100
parent 9493:55b40f3fa659
child 9501:8715961bfa13
line wrap: on
line diff
--- 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" };
 	};