slidge 0.2.11__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slidge/__init__.py +5 -2
- slidge/command/adhoc.py +9 -3
- slidge/command/admin.py +16 -12
- slidge/command/base.py +16 -12
- slidge/command/chat_command.py +25 -16
- slidge/command/user.py +7 -8
- slidge/contact/contact.py +123 -210
- slidge/contact/roster.py +108 -105
- slidge/core/config.py +2 -43
- slidge/core/dispatcher/caps.py +9 -2
- slidge/core/dispatcher/disco.py +13 -3
- slidge/core/dispatcher/message/__init__.py +1 -1
- slidge/core/dispatcher/message/chat_state.py +17 -8
- slidge/core/dispatcher/message/marker.py +7 -5
- slidge/core/dispatcher/message/message.py +120 -93
- slidge/core/dispatcher/muc/__init__.py +1 -1
- slidge/core/dispatcher/muc/admin.py +4 -4
- slidge/core/dispatcher/muc/mam.py +10 -6
- slidge/core/dispatcher/muc/misc.py +4 -2
- slidge/core/dispatcher/muc/owner.py +5 -3
- slidge/core/dispatcher/muc/ping.py +3 -1
- slidge/core/dispatcher/presence.py +26 -15
- slidge/core/dispatcher/registration.py +20 -12
- slidge/core/dispatcher/search.py +7 -3
- slidge/core/dispatcher/session_dispatcher.py +13 -5
- slidge/core/dispatcher/util.py +37 -27
- slidge/core/dispatcher/vcard.py +7 -4
- slidge/core/gateway.py +177 -87
- slidge/core/mixins/__init__.py +1 -11
- slidge/core/mixins/attachment.py +200 -147
- slidge/core/mixins/avatar.py +105 -177
- slidge/core/mixins/base.py +3 -1
- slidge/core/mixins/db.py +50 -2
- slidge/core/mixins/disco.py +1 -1
- slidge/core/mixins/message.py +19 -17
- slidge/core/mixins/message_maker.py +29 -15
- slidge/core/mixins/message_text.py +67 -30
- slidge/core/mixins/presence.py +94 -37
- slidge/core/pubsub.py +42 -47
- slidge/core/session.py +95 -60
- slidge/db/alembic/versions/cef02a8b1451_initial_schema.py +361 -0
- slidge/db/avatar.py +150 -119
- slidge/db/meta.py +33 -22
- slidge/db/models.py +69 -117
- slidge/db/store.py +414 -1094
- slidge/group/archive.py +65 -55
- slidge/group/bookmarks.py +96 -59
- slidge/group/participant.py +150 -144
- slidge/group/room.py +351 -328
- slidge/main.py +34 -22
- slidge/migration.py +17 -29
- slidge/slixfix/__init__.py +20 -4
- slidge/slixfix/delivery_receipt.py +6 -4
- slidge/slixfix/link_preview/link_preview.py +1 -1
- slidge/slixfix/link_preview/stanza.py +1 -1
- slidge/slixfix/roster.py +5 -7
- slidge/slixfix/xep_0077/register.py +8 -8
- slidge/slixfix/xep_0077/stanza.py +7 -7
- slidge/slixfix/xep_0100/gateway.py +12 -13
- slidge/slixfix/xep_0153/vcard_avatar.py +1 -1
- slidge/slixfix/xep_0292/vcard4.py +12 -2
- slidge/util/archive_msg.py +11 -5
- slidge/util/conf.py +27 -21
- slidge/util/jid_escaping.py +1 -1
- slidge/{core/mixins → util}/lock.py +6 -6
- slidge/util/test.py +30 -29
- slidge/util/types.py +24 -18
- slidge/util/util.py +26 -22
- {slidge-0.2.11.dist-info → slidge-0.3.0.dist-info}/METADATA +1 -1
- slidge-0.3.0.dist-info/RECORD +95 -0
- {slidge-0.2.11.dist-info → slidge-0.3.0.dist-info}/WHEEL +1 -1
- slidge/db/alembic/versions/04cf35e3cf85_add_participant_nickname_no_illegal.py +0 -33
- slidge/db/alembic/versions/09f27f098baa_add_missing_attributes_in_room.py +0 -36
- slidge/db/alembic/versions/15b0bd83407a_remove_bogus_unique_constraints_on_room_.py +0 -85
- slidge/db/alembic/versions/2461390c0af2_store_contacts_caps_verstring_in_db.py +0 -36
- slidge/db/alembic/versions/29f5280c61aa_store_subject_setter_in_room.py +0 -37
- slidge/db/alembic/versions/2b1f45ab7379_store_room_subject_setter_by_nickname.py +0 -41
- slidge/db/alembic/versions/3071e0fa69d4_add_contact_client_type.py +0 -52
- slidge/db/alembic/versions/45c24cc73c91_add_bob.py +0 -42
- slidge/db/alembic/versions/5bd48bfdffa2_lift_room_legacy_id_constraint.py +0 -61
- slidge/db/alembic/versions/82a4af84b679_add_muc_history_filled.py +0 -48
- slidge/db/alembic/versions/8b993243a536_add_vcard_content_to_contact_table.py +0 -43
- slidge/db/alembic/versions/8d2ced764698_rely_on_db_to_store_contacts_rooms_and_.py +0 -139
- slidge/db/alembic/versions/aa9d82a7f6ef_db_creation.py +0 -50
- slidge/db/alembic/versions/abba1ae0edb3_store_avatar_legacy_id_in_the_contact_.py +0 -79
- slidge/db/alembic/versions/b33993e87db3_move_everything_to_persistent_db.py +0 -214
- slidge/db/alembic/versions/b64b1a793483_add_source_and_legacy_id_for_archived_.py +0 -52
- slidge/db/alembic/versions/c4a8ec35a0e8_per_room_user_nick.py +0 -34
- slidge/db/alembic/versions/e91195719c2c_store_users_avatars_persistently.py +0 -26
- slidge-0.2.11.dist-info/RECORD +0 -112
- {slidge-0.2.11.dist-info → slidge-0.3.0.dist-info}/entry_points.txt +0 -0
- {slidge-0.2.11.dist-info → slidge-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {slidge-0.2.11.dist-info → slidge-0.3.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
slidge/__init__.py,sha256=OWGOMz8wl6I6XNUT9ipE9IFD-OinS8zQGGn4U_z3IWw,1835
|
2
|
+
slidge/__main__.py,sha256=ydjUklOoavS4YlGfjRX_8BQN2DaSbaXPMi47RkOgcFI,37
|
3
|
+
slidge/main.py,sha256=bUdAau6TorsPpDRBPfzvUolHlXF5K-BY9aJdSmNUcyw,7109
|
4
|
+
slidge/migration.py,sha256=b0Bi1D6QObpBhwZy33LvtYy3ObIx56pUdxgLfoQglh4,1271
|
5
|
+
slidge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
slidge/command/__init__.py,sha256=UYf1mjCYbZ5G7PIgaFTWSQRAzEJkQ6dTH8Fu_e_XnO0,613
|
7
|
+
slidge/command/adhoc.py,sha256=NCHammJdl30eHniiYukYQZKp1IeI-5qv5u9NncLNSNM,10760
|
8
|
+
slidge/command/admin.py,sha256=_utjSHGKeKtMTe2UHXVr2oQ_ZzCiG575pUQpVcO6tHE,6409
|
9
|
+
slidge/command/base.py,sha256=h6lQ6ypb5uNrppZ_N8mS7ObJpnOINYZS6QokGlWVgAk,13527
|
10
|
+
slidge/command/categories.py,sha256=vF0KGDV9sEn8TNkcMoDRw-u3gEyNHSXghOU2JRHQtKs,351
|
11
|
+
slidge/command/chat_command.py,sha256=r_qalygOCsEoS-OgWw8IIlAzTufhXNjduONbeoepUIA,11557
|
12
|
+
slidge/command/register.py,sha256=BduDI31Kx8CbWWEdjybimTA5Wcfhn-Jkt8sSPsySCpo,6724
|
13
|
+
slidge/command/user.py,sha256=VS7xuADXXes941OyiJbxC_C8d5hcqm-TSS4Gu82_8PQ,12173
|
14
|
+
slidge/contact/__init__.py,sha256=WMMaHk7UW7YT9EH2LtPdkU0bHQaOp4ikBhbBQskmoc8,191
|
15
|
+
slidge/contact/contact.py,sha256=uXHxfEsBNjTE0Tdk1s1_YETIazU03-pvaScd3QQmlu0,19607
|
16
|
+
slidge/contact/roster.py,sha256=uZ3iCl8oa7kEpIptUVa9p1k51bSvbuQq1pUGnf_zru8,9791
|
17
|
+
slidge/core/__init__.py,sha256=RG7Jj5JCJERjhqJ31lOLYV-7bH_oblClQD1KF9LsTXo,68
|
18
|
+
slidge/core/config.py,sha256=1HxHQ5BOnYghi8V5KbCQ6sUsNnXzAZAIoFA5PrMqH4E,6060
|
19
|
+
slidge/core/gateway.py,sha256=5GImsd1b7KKcwIZcNSWgVieezrnp5dJCv7IlmOvWkRc,41192
|
20
|
+
slidge/core/pubsub.py,sha256=-YK49tEdz_SLM3O8Y9zvu3p5KYhxgNpqbsD57rOIdNI,12141
|
21
|
+
slidge/core/session.py,sha256=Rji81tCEVI5zpKtKpMIuclKvDR0XuHZRki8ivIhtNnQ,29500
|
22
|
+
slidge/core/dispatcher/__init__.py,sha256=1EXcjXietUKlxEqdrCWCV3xZ3q_DSsjHoqWrPMbtYao,84
|
23
|
+
slidge/core/dispatcher/caps.py,sha256=gISaHtFwFDXtkSrSsAkZfPiHQyXfmXg3v_YYU0w9iDg,2254
|
24
|
+
slidge/core/dispatcher/disco.py,sha256=xVPyBFnnkON-JjjM1oydRa-dqnDbwAZER2MGQACRhVk,2309
|
25
|
+
slidge/core/dispatcher/presence.py,sha256=rxL2tDlH7a1NxfN_URDNFCHnjG_e-4Ke5UWMh8zXeOo,6928
|
26
|
+
slidge/core/dispatcher/registration.py,sha256=Qa3fYZFJ4NaVz-FsnXorCmMQ9WyO7oZte1Zvro5f74E,3415
|
27
|
+
slidge/core/dispatcher/search.py,sha256=bL5cwMOtsfnX5IH-t60S1PudpeMWZnF4-qksrKDuDyc,3411
|
28
|
+
slidge/core/dispatcher/session_dispatcher.py,sha256=ysgPhns7NgUxhmkgEwRv-yDkSnUIXEdc-FsgqDqQAkE,3466
|
29
|
+
slidge/core/dispatcher/util.py,sha256=DsMWz7yS67E2Y2pcnXUkuVMTa9F_Ok0JIxjhqhdYpD0,6161
|
30
|
+
slidge/core/dispatcher/vcard.py,sha256=qHZZShq3Iyvgh1FkcAgGhdKXF5m1VUqeb4EWkY0cbFw,5203
|
31
|
+
slidge/core/dispatcher/message/__init__.py,sha256=gNeZZ0wtCI9JBqMe6tpumwV1TjY0mnPWTJc94uFTN-I,244
|
32
|
+
slidge/core/dispatcher/message/chat_state.py,sha256=RbtM_nlZyvOHusZkDEP0TXA4wMp_N435490eE4wW8U0,2143
|
33
|
+
slidge/core/dispatcher/message/marker.py,sha256=WZyf72_SM6sDGPMEOzhu93o2KbgxSxNF25jwsiM7h2A,2439
|
34
|
+
slidge/core/dispatcher/message/message.py,sha256=RK1sX4cBSvPZLiUGYoT-pdCB01ll1761Ryr7Tu0AuBc,16202
|
35
|
+
slidge/core/dispatcher/muc/__init__.py,sha256=60YUr0i8PCZEPyNNTynJueRbbxF5pqzdyVf8z_XFXmM,290
|
36
|
+
slidge/core/dispatcher/muc/admin.py,sha256=1tDZ9hHD6q5SqCjsYOpDimPB3Iyl21YO5RnK1goEGso,3284
|
37
|
+
slidge/core/dispatcher/muc/mam.py,sha256=7vfmMI_mJOIrc9KCbtTibJSowhZTBBFwXWc84Ikpu3I,2994
|
38
|
+
slidge/core/dispatcher/muc/misc.py,sha256=FYo5FdmzksEuUCfCLLOOm8_8plXtZFQP8IzvzVv3Wug,4115
|
39
|
+
slidge/core/dispatcher/muc/owner.py,sha256=dDAxpRaA8H_NJQNIyBNixck2oG4GHZeEQqPhKd7MmDQ,3359
|
40
|
+
slidge/core/dispatcher/muc/ping.py,sha256=EgKKS9AvMnW-vINGcoGbtk6NdbN9A7zVaGfT5T7F6YE,1699
|
41
|
+
slidge/core/mixins/__init__.py,sha256=Zea39CCwjJU5XfHwcYPEZ9Sin8z1BZxoV68G2RwC3nE,386
|
42
|
+
slidge/core/mixins/attachment.py,sha256=6c1gZNydVZHgHB-_PjBLbT_9ntBSNG0AWqlv9Cgcku8,21906
|
43
|
+
slidge/core/mixins/avatar.py,sha256=0E0mQxdTUcJQrYXlBkYqkNl4bYuga4cIC1s4XA2rED8,5559
|
44
|
+
slidge/core/mixins/base.py,sha256=getXMptzJwIc4fEbeMoJCSKcC3awi8UbKnx5FVCthjc,783
|
45
|
+
slidge/core/mixins/db.py,sha256=a6idm-FgHWfDK-MJZWy5AkkBlyY8JmwOB8xAFmm0E9g,1934
|
46
|
+
slidge/core/mixins/disco.py,sha256=mrYhWO9qpnLMAVtKKqwbDh6CNOH2dPNERpyfmWzZGg8,3684
|
47
|
+
slidge/core/mixins/message.py,sha256=xk4bgiJF9ATe-rgtH4sHU8hUwecBF4KjGIujm90mbXQ,8014
|
48
|
+
slidge/core/mixins/message_maker.py,sha256=d9lMurnWCr7Y-pyyUkLoQYykb6lCCZuBNKFOe2hcY3A,6552
|
49
|
+
slidge/core/mixins/message_text.py,sha256=-hlGDzQ9dya-ZCPBe3v7UrpBetQa36N3YIACRxBt8Yc,9632
|
50
|
+
slidge/core/mixins/presence.py,sha256=DPNatkVIkw7GmHrkyUlUgsGhp0VUgaUgSBuhGalbe8c,9791
|
51
|
+
slidge/core/mixins/recipient.py,sha256=b0uFnpym-hOFgYxGjXT1xQcZ4YRbDSBftPcNWLzSwEI,1336
|
52
|
+
slidge/db/__init__.py,sha256=EBDH1JSEhgqYcli2Bw11CRC749wJk8AOucgBzmhDSvU,105
|
53
|
+
slidge/db/avatar.py,sha256=MXFd1oe0eL5CCUYbc5CpsIcbio3cY3xVoKt39RAoj9I,8240
|
54
|
+
slidge/db/meta.py,sha256=NtjGWcqPfG7uPfwR_cC6_23zyo8ftqgKX8CbP9IBq6U,2185
|
55
|
+
slidge/db/models.py,sha256=8z5bbaEINfU1Qx12iyHu4zRD9s3PwC6oUOz-PyBoqYg,12841
|
56
|
+
slidge/db/store.py,sha256=ZksmZlFaTia7eWy_trALc_iTEkk2x7CIlEQeYkHW21g,19408
|
57
|
+
slidge/db/alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
58
|
+
slidge/db/alembic/env.py,sha256=hsBlRNs0zF5diSHGRSa8Fi3qRVQDA2rJdR41AEIdvxc,1642
|
59
|
+
slidge/db/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
60
|
+
slidge/db/alembic/versions/cef02a8b1451_initial_schema.py,sha256=D1K-flfTM9Vkk0YFzg6HbmoDyEb2u5c751aXk2YzVVg,14881
|
61
|
+
slidge/group/__init__.py,sha256=yFt7cHqeaKIMN6f9ZyhhspOcJJvBtLedGv-iICG7lto,258
|
62
|
+
slidge/group/archive.py,sha256=aBcklo24UbpzIC8o7DrjaMb0zYzNlLbqoAHKOiltMAQ,6046
|
63
|
+
slidge/group/bookmarks.py,sha256=eiXtlgirE59dBi1BT1349wCrGuHDkCoak1phCepzkqI,7653
|
64
|
+
slidge/group/participant.py,sha256=mR_SJKA3WEONHdopZz2GtKuC8Srx9-V0-REhPxdZ_Gc,18118
|
65
|
+
slidge/group/room.py,sha256=3CiwiTYx0R6Ud5lP6otD6QEjwU3ZicUHKf3gJPmrUBo,49098
|
66
|
+
slidge/slixfix/__init__.py,sha256=LvaYZQYjr4l_45AYYpod1dB3MUaZye18vKF-4H8Bm20,4758
|
67
|
+
slidge/slixfix/delivery_receipt.py,sha256=JmogxsiXYEbTmCM4fvC5wkQs0jBsaJtKl4j_B_18riE,1415
|
68
|
+
slidge/slixfix/roster.py,sha256=DjjHQqCsKsPChUxV7S0Pm4IAgjfrwgm5tcTdJi3N_gY,1670
|
69
|
+
slidge/slixfix/link_preview/__init__.py,sha256=TDPTSEH5FQxgGpQpQIde-D72AHg-6YVWG-tOj4KpKmU,290
|
70
|
+
slidge/slixfix/link_preview/link_preview.py,sha256=_SeTvcNe_mPljLRp3rIKwOw0sXxpVIzMRF-Bkr3iMHw,456
|
71
|
+
slidge/slixfix/link_preview/stanza.py,sha256=0RC9dkD_3mzASq4nMYjyyytk9FqhOvkrv1Qbqf7hWqw,2672
|
72
|
+
slidge/slixfix/xep_0077/__init__.py,sha256=0lY1YXdgAsfrfxI_Woxaf1etHCJXe35Xtntq_icF6nA,325
|
73
|
+
slidge/slixfix/xep_0077/register.py,sha256=VtWFkQiqtbxke8lncwL9z32qWvuG40J38LYmWTQKUoE,10500
|
74
|
+
slidge/slixfix/xep_0077/stanza.py,sha256=u1rolvn-vRTMUSIxfWyFIveWz7Z6BWW3QmLh5o-g8vM,2471
|
75
|
+
slidge/slixfix/xep_0100/__init__.py,sha256=AtEXDQOrEWodkN3fgKR0W3Ezsz_Zza6cgO5ZaZS-JOo,107
|
76
|
+
slidge/slixfix/xep_0100/gateway.py,sha256=iK_a6XQGh6bYqSMAZw4i-7Fb0nguvGDQkuvxIeYIxKg,4330
|
77
|
+
slidge/slixfix/xep_0100/stanza.py,sha256=7vCzej9VFQupsTpGGl0cJWuGNH4I6oVcckBu_-fE55c,232
|
78
|
+
slidge/slixfix/xep_0153/__init__.py,sha256=hsEldnLuzvcp0NqSscxPV7FJl-6GFP372vlDg1G3S3I,283
|
79
|
+
slidge/slixfix/xep_0153/vcard_avatar.py,sha256=Oq4bV1XomedjIb9eWCGB5xxW_IDoRRYNTfQ-GYhzLYI,466
|
80
|
+
slidge/slixfix/xep_0292/__init__.py,sha256=_MvS9wGra6ig3P_dPAVlCPDJkiOFvUWGjaRsHj1woUg,98
|
81
|
+
slidge/slixfix/xep_0292/vcard4.py,sha256=gC17q8TyV3YM37U8ei3od7HNP02GYH0YpSymjso6f6g,652
|
82
|
+
slidge/util/__init__.py,sha256=BELovoTMPcPPGz3D48esBr8A4BRRHXTvavfgnArBgEc,301
|
83
|
+
slidge/util/archive_msg.py,sha256=hGNquu38ouSWSc-kz_oAYPXwjhUVZNSedIpwkrXHSd0,1826
|
84
|
+
slidge/util/conf.py,sha256=Wv-xr1fQfz6jDCBpj2e5Nm-igMpdIjsYsVfoY8grJoo,7380
|
85
|
+
slidge/util/jid_escaping.py,sha256=QJ2Yj_j1gTmiO9g2r187iVCu7kia_O5ABhRiLAO2TG4,1073
|
86
|
+
slidge/util/lock.py,sha256=ZnUi3LGiz271-YeYKo9JzxovJCoSwlP9P65pNyHIO9o,1029
|
87
|
+
slidge/util/test.py,sha256=_E6er2BtQlpyzTUmp4u8C9KhBYzbLrmTwSVgxGObKHU,13988
|
88
|
+
slidge/util/types.py,sha256=nilphTeJU3yb0MSqb86tZeWXis495oDvHSDDBs0hn_4,5747
|
89
|
+
slidge/util/util.py,sha256=PBdHtcRIQi6Dy-yHASS_xiRGQ4Pv4i6QSSZAAELPnmQ,9536
|
90
|
+
slidge-0.3.0.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
91
|
+
slidge-0.3.0.dist-info/METADATA,sha256=jjRQ_9npMttUYymOzS2ckcjhoTw9D07n0WeEmNvZUZ8,5054
|
92
|
+
slidge-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
93
|
+
slidge-0.3.0.dist-info/entry_points.txt,sha256=py3_x834fFJ2TEzPd18Wt2DnysdAfuVqJ5zzBrXbAZs,44
|
94
|
+
slidge-0.3.0.dist-info/top_level.txt,sha256=2LRjDYHaGZ5ieCMF8xy58JIiabRMzX-MGMbCZwfE17c,7
|
95
|
+
slidge-0.3.0.dist-info/RECORD,,
|
@@ -1,33 +0,0 @@
|
|
1
|
-
"""Add Participant.nickname_no_illegal
|
2
|
-
|
3
|
-
Revision ID: 04cf35e3cf85
|
4
|
-
Revises: 15b0bd83407a
|
5
|
-
Create Date: 2025-02-22 06:57:45.491326
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "04cf35e3cf85"
|
16
|
-
down_revision: Union[str, None] = "15b0bd83407a"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
with op.batch_alter_table("participant", schema=None) as batch_op:
|
24
|
-
batch_op.add_column(
|
25
|
-
sa.Column("nickname_no_illegal", sa.String(), nullable=True)
|
26
|
-
)
|
27
|
-
|
28
|
-
# ### end Alembic commands ###
|
29
|
-
|
30
|
-
|
31
|
-
def downgrade() -> None:
|
32
|
-
with op.batch_alter_table("participant", schema=None) as batch_op:
|
33
|
-
batch_op.drop_column("nickname_no_illegal")
|
@@ -1,36 +0,0 @@
|
|
1
|
-
"""Add n_participants attributes to Room
|
2
|
-
|
3
|
-
Should have been part of another commit, but I messed up some rebase
|
4
|
-
|
5
|
-
Revision ID: 09f27f098baa
|
6
|
-
Revises: 29f5280c61aa
|
7
|
-
Create Date: 2024-07-11 10:54:21.155871
|
8
|
-
|
9
|
-
"""
|
10
|
-
|
11
|
-
from typing import Sequence, Union
|
12
|
-
|
13
|
-
import sqlalchemy as sa
|
14
|
-
from alembic import op
|
15
|
-
|
16
|
-
# revision identifiers, used by Alembic.
|
17
|
-
revision: str = "09f27f098baa"
|
18
|
-
down_revision: Union[str, None] = "29f5280c61aa"
|
19
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
20
|
-
depends_on: Union[str, Sequence[str], None] = None
|
21
|
-
|
22
|
-
|
23
|
-
def upgrade() -> None:
|
24
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
25
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
26
|
-
batch_op.add_column(sa.Column("n_participants", sa.Integer(), nullable=True))
|
27
|
-
|
28
|
-
# ### end Alembic commands ###
|
29
|
-
|
30
|
-
|
31
|
-
def downgrade() -> None:
|
32
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
33
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
34
|
-
batch_op.drop_column("n_participants")
|
35
|
-
|
36
|
-
# ### end Alembic commands ###
|
@@ -1,85 +0,0 @@
|
|
1
|
-
"""Remove bogus unique constraints on room table
|
2
|
-
|
3
|
-
Revision ID: 15b0bd83407a
|
4
|
-
Revises: 45c24cc73c91
|
5
|
-
Create Date: 2024-08-28 06:57:25.022994
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
import slidge.db.meta
|
15
|
-
|
16
|
-
# revision identifiers, used by Alembic.
|
17
|
-
revision: str = "15b0bd83407a"
|
18
|
-
down_revision: Union[str, None] = "45c24cc73c91"
|
19
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
20
|
-
depends_on: Union[str, Sequence[str], None] = None
|
21
|
-
|
22
|
-
meta = sa.MetaData()
|
23
|
-
room_table = sa.Table(
|
24
|
-
"room",
|
25
|
-
meta,
|
26
|
-
sa.Column("id", sa.Integer(), nullable=False),
|
27
|
-
sa.Column("user_account_id", sa.Integer(), nullable=False),
|
28
|
-
sa.Column("legacy_id", sa.String(), nullable=False),
|
29
|
-
sa.Column("jid", slidge.db.meta.JIDType(), nullable=False),
|
30
|
-
sa.Column("avatar_id", sa.Integer(), nullable=True),
|
31
|
-
sa.Column("name", sa.String(), nullable=True),
|
32
|
-
sa.Column("description", sa.String(), nullable=True),
|
33
|
-
sa.Column("subject", sa.String(), nullable=True),
|
34
|
-
sa.Column("subject_date", sa.DateTime(), nullable=True),
|
35
|
-
sa.Column("subject_setter", sa.String(), nullable=True),
|
36
|
-
sa.Column("n_participants", sa.Integer(), nullable=True),
|
37
|
-
sa.Column(
|
38
|
-
"muc_type",
|
39
|
-
sa.Enum("GROUP", "CHANNEL", "CHANNEL_NON_ANONYMOUS", name="muctype"),
|
40
|
-
nullable=True,
|
41
|
-
),
|
42
|
-
sa.Column("user_nick", sa.String(), nullable=True),
|
43
|
-
sa.Column("user_resources", sa.String(), nullable=True),
|
44
|
-
sa.Column("participants_filled", sa.Boolean(), nullable=False),
|
45
|
-
sa.Column("history_filled", sa.Boolean(), nullable=False),
|
46
|
-
sa.Column("extra_attributes", slidge.db.meta.JSONEncodedDict(), nullable=True),
|
47
|
-
sa.Column("updated", sa.Boolean(), nullable=False),
|
48
|
-
sa.Column("avatar_legacy_id", sa.String(), nullable=True),
|
49
|
-
sa.ForeignKeyConstraint(
|
50
|
-
["avatar_id"],
|
51
|
-
["avatar.id"],
|
52
|
-
),
|
53
|
-
sa.ForeignKeyConstraint(
|
54
|
-
["user_account_id"],
|
55
|
-
["user_account.id"],
|
56
|
-
),
|
57
|
-
sa.PrimaryKeyConstraint("id"),
|
58
|
-
)
|
59
|
-
|
60
|
-
|
61
|
-
def upgrade() -> None:
|
62
|
-
if op.get_bind().engine.name == "postgresql":
|
63
|
-
return
|
64
|
-
with op.batch_alter_table(
|
65
|
-
"room",
|
66
|
-
schema=None,
|
67
|
-
# without copy_from, the newly created table keeps the constraints
|
68
|
-
# we actually want to ditch.
|
69
|
-
copy_from=room_table,
|
70
|
-
) as batch_op:
|
71
|
-
batch_op.create_unique_constraint(
|
72
|
-
"uq_room_user_account_id_jid", ["user_account_id", "jid"]
|
73
|
-
)
|
74
|
-
batch_op.create_unique_constraint(
|
75
|
-
"uq_room_user_account_id_legacy_id", ["user_account_id", "legacy_id"]
|
76
|
-
)
|
77
|
-
|
78
|
-
|
79
|
-
def downgrade() -> None:
|
80
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
81
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
82
|
-
batch_op.drop_constraint("uq_room_user_account_id_legacy_id", type_="unique")
|
83
|
-
batch_op.drop_constraint("uq_room_user_account_id_jid", type_="unique")
|
84
|
-
|
85
|
-
# ### end Alembic commands ###
|
@@ -1,36 +0,0 @@
|
|
1
|
-
"""Store contacts caps verstring in DB
|
2
|
-
|
3
|
-
Revision ID: 2461390c0af2
|
4
|
-
Revises: 2b1f45ab7379
|
5
|
-
Create Date: 2024-07-20 08:00:11.675735
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "2461390c0af2"
|
16
|
-
down_revision: Union[str, None] = "2b1f45ab7379"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
24
|
-
batch_op.add_column(sa.Column("caps_ver_bare", sa.String(), nullable=True))
|
25
|
-
batch_op.add_column(sa.Column("caps_ver", sa.String(), nullable=True))
|
26
|
-
|
27
|
-
# ### end Alembic commands ###
|
28
|
-
|
29
|
-
|
30
|
-
def downgrade() -> None:
|
31
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
32
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
33
|
-
batch_op.drop_column("caps_ver")
|
34
|
-
batch_op.drop_column("caps_ver_bare")
|
35
|
-
|
36
|
-
# ### end Alembic commands ###
|
@@ -1,37 +0,0 @@
|
|
1
|
-
"""Store subject setter in Room
|
2
|
-
|
3
|
-
Revision ID: 29f5280c61aa
|
4
|
-
Revises: 8d2ced764698
|
5
|
-
Create Date: 2024-07-10 13:09:25.181594
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "29f5280c61aa"
|
16
|
-
down_revision: Union[str, None] = "8d2ced764698"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
23
|
-
batch_op.add_column(sa.Column("subject_setter_id", sa.Integer(), nullable=True))
|
24
|
-
# we give this constraint a name a workaround for
|
25
|
-
# https://github.com/sqlalchemy/alembic/issues/1195
|
26
|
-
batch_op.create_foreign_key(
|
27
|
-
"subject_setter_id_foreign_key",
|
28
|
-
"participant",
|
29
|
-
["subject_setter_id"],
|
30
|
-
["id"],
|
31
|
-
)
|
32
|
-
|
33
|
-
|
34
|
-
def downgrade() -> None:
|
35
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
36
|
-
batch_op.drop_constraint("subject_setter_id_foreign_key", type_="foreignkey")
|
37
|
-
batch_op.drop_column("subject_setter_id")
|
@@ -1,41 +0,0 @@
|
|
1
|
-
"""Store room subject setter by nickname
|
2
|
-
|
3
|
-
Revision ID: 2b1f45ab7379
|
4
|
-
Revises: c4a8ec35a0e8
|
5
|
-
Create Date: 2024-07-20 00:14:36.882689
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "2b1f45ab7379"
|
16
|
-
down_revision: Union[str, None] = "c4a8ec35a0e8"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
24
|
-
batch_op.add_column(sa.Column("subject_setter", sa.String(), nullable=True))
|
25
|
-
batch_op.drop_constraint("subject_setter_id_foreign_key", type_="foreignkey")
|
26
|
-
batch_op.drop_column("subject_setter_id")
|
27
|
-
# ### end Alembic commands ###
|
28
|
-
|
29
|
-
|
30
|
-
def downgrade() -> None:
|
31
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
32
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
33
|
-
batch_op.add_column(sa.Column("subject_setter_id", sa.INTEGER(), nullable=True))
|
34
|
-
batch_op.create_foreign_key(
|
35
|
-
"subject_setter_id_foreign_key",
|
36
|
-
"participant",
|
37
|
-
["subject_setter_id"],
|
38
|
-
["id"],
|
39
|
-
)
|
40
|
-
batch_op.drop_column("subject_setter")
|
41
|
-
# ### end Alembic commands ###
|
@@ -1,52 +0,0 @@
|
|
1
|
-
"""Add Contact.client_type
|
2
|
-
|
3
|
-
Revision ID: 3071e0fa69d4
|
4
|
-
Revises: abba1ae0edb3
|
5
|
-
Create Date: 2024-07-30 23:12:49.345593
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "3071e0fa69d4"
|
16
|
-
down_revision: Union[str, None] = "abba1ae0edb3"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
24
|
-
batch_op.add_column(
|
25
|
-
sa.Column(
|
26
|
-
"client_type",
|
27
|
-
sa.Enum(
|
28
|
-
"bot",
|
29
|
-
"console",
|
30
|
-
"game",
|
31
|
-
"handheld",
|
32
|
-
"pc",
|
33
|
-
"phone",
|
34
|
-
"sms",
|
35
|
-
"tablet",
|
36
|
-
"web",
|
37
|
-
native_enum=False,
|
38
|
-
),
|
39
|
-
nullable=False,
|
40
|
-
server_default=sa.literal("pc"),
|
41
|
-
)
|
42
|
-
)
|
43
|
-
|
44
|
-
# ### end Alembic commands ###
|
45
|
-
|
46
|
-
|
47
|
-
def downgrade() -> None:
|
48
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
49
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
50
|
-
batch_op.drop_column("client_type")
|
51
|
-
|
52
|
-
# ### end Alembic commands ###
|
@@ -1,42 +0,0 @@
|
|
1
|
-
"""Add BoB
|
2
|
-
|
3
|
-
Revision ID: 45c24cc73c91
|
4
|
-
Revises: 3071e0fa69d4
|
5
|
-
Create Date: 2024-08-01 22:30:07.073935
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "45c24cc73c91"
|
16
|
-
down_revision: Union[str, None] = "3071e0fa69d4"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
op.create_table(
|
24
|
-
"bob",
|
25
|
-
sa.Column("id", sa.Integer(), nullable=False),
|
26
|
-
sa.Column("file_name", sa.String(), nullable=False),
|
27
|
-
sa.Column("sha_1", sa.String(), nullable=False),
|
28
|
-
sa.Column("sha_256", sa.String(), nullable=False),
|
29
|
-
sa.Column("sha_512", sa.String(), nullable=False),
|
30
|
-
sa.Column("content_type", sa.String(), nullable=False),
|
31
|
-
sa.PrimaryKeyConstraint("id"),
|
32
|
-
sa.UniqueConstraint("sha_1"),
|
33
|
-
sa.UniqueConstraint("sha_256"),
|
34
|
-
sa.UniqueConstraint("sha_512"),
|
35
|
-
)
|
36
|
-
# ### end Alembic commands ###
|
37
|
-
|
38
|
-
|
39
|
-
def downgrade() -> None:
|
40
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
41
|
-
op.drop_table("bob")
|
42
|
-
# ### end Alembic commands ###
|
@@ -1,61 +0,0 @@
|
|
1
|
-
"""Lift room legacy ID constraint
|
2
|
-
|
3
|
-
Revision ID: 5bd48bfdffa2
|
4
|
-
Revises: b64b1a793483
|
5
|
-
Create Date: 2024-07-24 10:29:23.467851
|
6
|
-
|
7
|
-
Broken; fixed by "Remove bogus unique constraints on room table",
|
8
|
-
rev 15b0bd83407a.
|
9
|
-
|
10
|
-
"""
|
11
|
-
|
12
|
-
import logging
|
13
|
-
from typing import Sequence, Union
|
14
|
-
|
15
|
-
from alembic import op
|
16
|
-
|
17
|
-
from slidge.db.models import Room
|
18
|
-
|
19
|
-
# revision identifiers, used by Alembic.
|
20
|
-
revision: str = "5bd48bfdffa2"
|
21
|
-
down_revision: Union[str, None] = "b64b1a793483"
|
22
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
23
|
-
depends_on: Union[str, Sequence[str], None] = None
|
24
|
-
|
25
|
-
|
26
|
-
def upgrade() -> None:
|
27
|
-
try:
|
28
|
-
with op.batch_alter_table(
|
29
|
-
"room",
|
30
|
-
schema=None,
|
31
|
-
# without copy_from, the newly created table keeps the constraints
|
32
|
-
# we actually want to ditch.
|
33
|
-
# LATER EDIT: this actually does not work, I should have copied the
|
34
|
-
# schema in here.
|
35
|
-
copy_from=Room.__table__, # type:ignore
|
36
|
-
) as batch_op:
|
37
|
-
batch_op.create_unique_constraint(
|
38
|
-
"uq_room_user_account_id_jid", ["user_account_id", "jid"]
|
39
|
-
)
|
40
|
-
batch_op.create_unique_constraint(
|
41
|
-
"uq_room_user_account_id_legacy_id", ["user_account_id", "legacy_id"]
|
42
|
-
)
|
43
|
-
except Exception:
|
44
|
-
# This only works when upgrading rev by rev because I messed up. It
|
45
|
-
# wouldn't be necessary if the constraint was named in the first place,
|
46
|
-
# cf https://alembic.sqlalchemy.org/en/latest/naming.html
|
47
|
-
# This is fixed by rev 15b0bd83407a
|
48
|
-
log.info("Skipping")
|
49
|
-
pass
|
50
|
-
|
51
|
-
|
52
|
-
def downgrade() -> None:
|
53
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
54
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
55
|
-
batch_op.drop_constraint("uq_room_user_account_id_legacy_id", type_="unique")
|
56
|
-
batch_op.drop_constraint("uq_room_user_account_id_jid", type_="unique")
|
57
|
-
|
58
|
-
# ### end Alembic commands ###
|
59
|
-
|
60
|
-
|
61
|
-
log = logging.getLogger(__name__)
|
@@ -1,48 +0,0 @@
|
|
1
|
-
"""Add MUC.history_filled
|
2
|
-
|
3
|
-
Also drop caps_ver_bare column that should never have been added.
|
4
|
-
|
5
|
-
Revision ID: 82a4af84b679
|
6
|
-
Revises: 2461390c0af2
|
7
|
-
Create Date: 2024-07-22 07:01:05.352737
|
8
|
-
|
9
|
-
"""
|
10
|
-
|
11
|
-
from typing import Sequence, Union
|
12
|
-
|
13
|
-
import sqlalchemy as sa
|
14
|
-
from alembic import op
|
15
|
-
|
16
|
-
# revision identifiers, used by Alembic.
|
17
|
-
revision: str = "82a4af84b679"
|
18
|
-
down_revision: Union[str, None] = "2461390c0af2"
|
19
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
20
|
-
depends_on: Union[str, Sequence[str], None] = None
|
21
|
-
|
22
|
-
|
23
|
-
def upgrade() -> None:
|
24
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
25
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
26
|
-
batch_op.drop_column("caps_ver_bare")
|
27
|
-
|
28
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
29
|
-
batch_op.add_column(
|
30
|
-
sa.Column(
|
31
|
-
"history_filled",
|
32
|
-
sa.Boolean(),
|
33
|
-
nullable=False,
|
34
|
-
server_default=sa.False_(), # manually added
|
35
|
-
)
|
36
|
-
)
|
37
|
-
# ### end Alembic commands ###
|
38
|
-
|
39
|
-
|
40
|
-
def downgrade() -> None:
|
41
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
42
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
43
|
-
batch_op.drop_column("history_filled")
|
44
|
-
|
45
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
46
|
-
batch_op.add_column(sa.Column("caps_ver_bare", sa.VARCHAR(), nullable=True))
|
47
|
-
|
48
|
-
# ### end Alembic commands ###
|
@@ -1,43 +0,0 @@
|
|
1
|
-
"""Add vcard content to contact table
|
2
|
-
|
3
|
-
Revision ID: 8b993243a536
|
4
|
-
Revises: 5bd48bfdffa2
|
5
|
-
Create Date: 2024-07-24 07:02:47.770894
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "8b993243a536"
|
16
|
-
down_revision: Union[str, None] = "5bd48bfdffa2"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
24
|
-
batch_op.add_column(sa.Column("vcard", sa.String(), nullable=True))
|
25
|
-
batch_op.add_column(
|
26
|
-
sa.Column(
|
27
|
-
"vcard_fetched",
|
28
|
-
sa.Boolean(),
|
29
|
-
nullable=False,
|
30
|
-
server_default=sa.sql.true(),
|
31
|
-
)
|
32
|
-
)
|
33
|
-
|
34
|
-
# ### end Alembic commands ###
|
35
|
-
|
36
|
-
|
37
|
-
def downgrade() -> None:
|
38
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
39
|
-
with op.batch_alter_table("contact", schema=None) as batch_op:
|
40
|
-
batch_op.drop_column("vcard_fetched")
|
41
|
-
batch_op.drop_column("vcard")
|
42
|
-
|
43
|
-
# ### end Alembic commands ###
|