增加按设备统计的群消息未读角标
This commit is contained in:
1 parent
f54077ce46
commit
187923ca3c
16 files changed
+189
-23
No files matched your search
@@ -0,0 +1,9 @@
|
||||
CREATE TABLE group_seen (
|
||||
group_id uuid NOT NULL,
|
||||
user_id uuid NOT NULL,
|
||||
device_id uuid NOT NULL REFERENCES devices(id) ON DELETE CASCADE,
|
||||
sequence bigint NOT NULL CHECK (sequence > 0),
|
||||
PRIMARY KEY (group_id,device_id),
|
||||
FOREIGN KEY (group_id,user_id) REFERENCES group_members(group_id,user_id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX group_seen_membership ON group_seen(group_id,user_id);
|
||||
@@ -37,6 +37,9 @@ var groupAttachmentsMigration string
|
||||
//go:embed 010_group_preferences.sql
|
||||
var groupPreferencesMigration string
|
||||
|
||||
//go:embed 011_group_seen.sql
|
||||
var groupSeenMigration string
|
||||
|
||||
func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
|
||||
tx, err := pool.Begin(ctx)
|
||||
if err != nil {
|
||||
@@ -52,6 +55,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,
|
||||
} {
|
||||
version := index + 1
|
||||
var applied bool
|
||||
|
||||
Reference in new issue
Block a user