Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
9499:36e379f058c8 | 9500:7de89d66cbb9 |
---|---|
494 Column { name="key", type="TEXT", nullable=false }; -- item id | 494 Column { name="key", type="TEXT", nullable=false }; -- item id |
495 Column { name="when", type="INTEGER", nullable=false }; -- timestamp | 495 Column { name="when", type="INTEGER", nullable=false }; -- timestamp |
496 Column { name="with", type="TEXT", nullable=false }; -- related id | 496 Column { name="with", type="TEXT", nullable=false }; -- related id |
497 Column { name="type", type="TEXT", nullable=false }; | 497 Column { name="type", type="TEXT", nullable=false }; |
498 Column { name="value", type="MEDIUMTEXT", nullable=false }; | 498 Column { name="value", type="MEDIUMTEXT", nullable=false }; |
499 Index { name="prosodyarchive_index", "host", "user", "store", "key" }; | 499 Index { name="prosodyarchive_index", unique = engine.params.driver ~= "MySQL", "host", "user", "store", "key" }; |
500 Index { name="prosodyarchive_with_when", "host", "user", "store", "with", "when" }; | 500 Index { name="prosodyarchive_with_when", "host", "user", "store", "with", "when" }; |
501 Index { name="prosodyarchive_when", "host", "user", "store", "when" }; | 501 Index { name="prosodyarchive_when", "host", "user", "store", "when" }; |
502 }; | 502 }; |
503 engine:transaction(function() | 503 engine:transaction(function() |
504 ProsodyArchiveTable:create(engine); | 504 ProsodyArchiveTable:create(engine); |