Philipp Hörist pushed to branch storage at gajim / gajim
Commits:
453a56de by Philipp Hörist at 2024-04-09T21:33:48+02:00
imprv: Remove stanza id index
- - - - -
2 changed files:
- gajim/common/storage/archive/models.py
- test/database/test_messages.py
Changes:
=====================================
gajim/common/storage/archive/models.py
=====================================
@@ -668,13 +668,6 @@ class Message(MappedAsDataclass, Base, UtilMixin,
kw_only=True):
Index(
'idx_message_id', 'id', 'fk_remote_pk', 'fk_account_pk',
),
- Index(
- 'idx_stanza_id_unique',
- 'stanza_id',
- 'fk_remote_pk',
- 'fk_account_pk',
- unique=True,
- ),
)
def get_latest_marker(self) -> Marker | None:
=====================================
test/database/test_messages.py
=====================================
@@ -4,7 +4,6 @@
from datetime import datetime
from datetime import timezone
-import sqlalchemy.exc
from nbxmpp.protocol import JID
from gajim.common import app
@@ -53,14 +52,5 @@ def _create_base_message(
text='message',
)
- def test_stanza_id_index(self) -> None:
- message_data = self._create_base_message(message_id='1',
stanza_id='s1')
- self._archive.insert_object(message_data, ignore_on_conflict=False)
-
- with self.assertRaises(sqlalchemy.exc.IntegrityError):
- message_data = self._create_base_message(message_id='2',
stanza_id='s1')
- self._archive.insert_object(message_data, ignore_on_conflict=False)
-
-
if __name__ == '__main__':
unittest.main()
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/453a56dee683eb5ac2b9b98a3e372bf5bdbd6534
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/453a56dee683eb5ac2b9b98a3e372bf5bdbd6534
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]