Mercurial > libervia-backend
annotate sat/plugins/__init__.py @ 2716:06160b529da6
core (memory/sqlite): changed history constraint
/!\ Database schema change /!\
History was using a unique constraint on `profile_id, timestamp, source, dest, source_res, dest_res`, which can cause trouble because several messages send quickly by the same person can have a common timestamp (specially with delayed messages where precision is second), resulting in message loss.
The new constraint use `profile_id, stanza_id, source, dest` where `stanza_id` is XEP-0359 stanza_id, so it's unique by definition, and no message should be lost anymore.
Because sqlite doesn't support altering table with a constraint change, we have to create new tables and copy old data to new one, which can be pretty long.
Sqlite update mechanism with "specifics" has been fixed when several updates are applied (e.g. moving from v5 to v7) and a specific is in the workflow.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 09 Dec 2018 14:07:26 +0100 |
parents | 56f94936df1e |
children | f7deb1c36b47 |
rev | line source |
---|---|
1460
c7fd121a6180
core: getProfileName no raise ProfileUnknownError + minor doc fixes
Goffi <goffi@goffi.org>
parents:
1285
diff
changeset
|
1 # FIXME: remove this when RSM and MAM are in wokkel |
c7fd121a6180
core: getProfileName no raise ProfileUnknownError + minor doc fixes
Goffi <goffi@goffi.org>
parents:
1285
diff
changeset
|
2 # XXX: the Monkey Patch is here and not in src/__init__ to avoir issues with pyjamas compilation |
1266
9141bde7ff31
use sat.tmp.wokkel as a buffer module until the changes are integrated to wokkel
souliane <souliane@mailoo.org>
parents:
223
diff
changeset
|
3 import wokkel |
2413
70399d1acb47
tmp: removed sat.tmp hierarchy and fixed references to it as it is now an independant sat_tmp repository
Goffi <goffi@goffi.org>
parents:
1767
diff
changeset
|
4 from sat_tmp.wokkel import pubsub as tmp_pubsub, rsm as tmp_rsm, mam as tmp_mam |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2562
diff
changeset
|
5 |
1285
ed2c718bfe03
tmp, plugins: fixes the imports fron sat.tmp
souliane <souliane@mailoo.org>
parents:
1283
diff
changeset
|
6 wokkel.pubsub = tmp_pubsub |
ed2c718bfe03
tmp, plugins: fixes the imports fron sat.tmp
souliane <souliane@mailoo.org>
parents:
1283
diff
changeset
|
7 wokkel.rsm = tmp_rsm |
ed2c718bfe03
tmp, plugins: fixes the imports fron sat.tmp
souliane <souliane@mailoo.org>
parents:
1283
diff
changeset
|
8 wokkel.mam = tmp_mam |