增加私聊置顶和按设备统计未读
This commit is contained in:
1 parent
7e165ba9b4
commit
ec2679b991
19 files changed
+312
-52
No files matched your search
@@ -0,0 +1,13 @@
|
||||
ALTER TABLE contact_preferences ADD COLUMN pinned boolean NOT NULL DEFAULT false;
|
||||
ALTER TABLE device_envelopes ADD COLUMN counts_as_unread boolean NOT NULL DEFAULT false;
|
||||
|
||||
CREATE INDEX device_envelopes_unread ON device_envelopes(recipient_device, sender_device, sequence)
|
||||
WHERE counts_as_unread;
|
||||
|
||||
CREATE TABLE device_contact_seen (
|
||||
recipient_device uuid NOT NULL REFERENCES devices(id) ON DELETE CASCADE,
|
||||
sender_device uuid NOT NULL REFERENCES devices(id) ON DELETE CASCADE,
|
||||
sequence bigint NOT NULL CHECK (sequence > 0),
|
||||
PRIMARY KEY (recipient_device, sender_device),
|
||||
CHECK (recipient_device <> sender_device)
|
||||
);
|
||||
@@ -46,6 +46,9 @@ var groupInviteLinkMigration string
|
||||
//go:embed 013_contact_mute.sql
|
||||
var contactMuteMigration string
|
||||
|
||||
//go:embed 014_private_conversations.sql
|
||||
var privateConversationsMigration string
|
||||
|
||||
func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
|
||||
tx, err := pool.Begin(ctx)
|
||||
if err != nil {
|
||||
@@ -61,7 +64,7 @@ func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
|
||||
for index, migration := range []string{
|
||||
identityMigration, contactsMigration, deliveryMigration, keyPackagesMigration, mlsCredentialsMigration,
|
||||
attachmentsMigration, groupsMigration, groupTransportMigration, groupAttachmentsMigration, groupPreferencesMigration,
|
||||
groupSeenMigration, groupInviteLinkMigration, contactMuteMigration,
|
||||
groupSeenMigration, groupInviteLinkMigration, contactMuteMigration, privateConversationsMigration,
|
||||
} {
|
||||
version := index + 1
|
||||
var applied bool
|
||||
|
||||
Reference in new issue
Block a user