dd49e604d4
This property is useful for clients to know when a channel or chat was joined so they can use that to calculate the order of channels and chats shown in applications. Changes include a new joined property on the Chat struct, as well as adjustments in the persistence layer to retreive and update chat data in the database. In addition there's a migration script that alters the existing chat table to introduce a new column for the joined field. It also updates all existing rows in the database to set `joined` to `0`. |
||
---|---|---|
.. | ||
000001_init.down.db.sql | ||
000001_init.up.db.sql | ||
000002_add_last_ens_clock_value.up.sql | ||
1586358095_add_replace.up.sql | ||
1588665364_add_image_data.up.sql | ||
1589365189_add_pow_target.up.sql | ||
1591277220_add_index_messages.up.sql | ||
1593087212_add_mute_chat_and_raw_message_fields.up.sql | ||
1595862781_add_audio_data.up.sql | ||
1595865249_create_emoji_reactions_table.up.sql | ||
1596805115_create_group_chat_invitations_table.up.sql | ||
1597322655_add_invitation_admin_chat_field.up.sql | ||
1597757544_add_nickname.up.sql | ||
1598955122_add_mentions.up.sql | ||
1599641390_add_emoji_reactions_index.up.sql | ||
1599720851_add_seen_index_remove_long_messages.up.sql | ||
1603198582_add_profile_chat_field.up.sql | ||
1603816533_add_links.up.sql | ||
1603888149_create_chat_identity_last_published_table.up.sql | ||
1605075346_add_communities.up.sql | ||
1610117927_add_message_cache.up.sql | ||
1610959908_add_dont_wrap_to_raw_messages.up.sql | ||
1610960912_add_send_on_personal_topic.up.sql | ||
1612870480_add_datasync_id.up.sql | ||
1614152139_add_communities_request_to_join.up.sql | ||
1615374373_add_confirmations.up.sql | ||
1617694931_add_notification_center.up.sql | ||
1618923660_create_pin_messages.up.sql | ||
1619094007_add_joined_chat_field.up.sql | ||
README.md | ||
doc.go |
README.md
How to write migrations?
We only write up
migrations, down
migrations are not always possible in sqlite or
too complex/too expensive. For example to remove a column you would have to duplicate
the table, copy over the data, delete and recreated.
This can be very expensive for some tables (user_messages for example), so should not be attempted.
Notes
One issue we faced multiple times is that updates to user_messages
can be very
expensive, leading to slow upgrade times and interrupted migrations. So avoid
writes if not necessary.