Skip to content

Commit 94dee19

Browse files
committed
Replace is_tombstone with removal timestamp
1 parent 21a5d22 commit 94dee19

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/sql/migrations.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,11 +1140,17 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid);
11401140

11411141
inc_and_check(&mut migration_version, 128)?;
11421142
if dbversion < migration_version {
1143+
// Add the timestamp of addition and removal.
1144+
//
1145+
// If `add_timestamp >= remove_timestamp`,
1146+
// then the member is currently a member of the chat.
1147+
// If `add_timestamp < remove_timestamp`,
1148+
// then the member is a past member.
11431149
sql.execute_migration(
11441150
"ALTER TABLE chats_contacts
1145-
ADD COLUMN timestamp NOT NULL DEFAULT 0;
1151+
ADD COLUMN add_timestamp NOT NULL DEFAULT 0;
11461152
ALTER TABLE chats_contacts
1147-
ADD COLUMN is_tombstone NOT NULL DEFAULT FALSE;
1153+
ADD COLUMN remove_timestamp NOT NULL DEFAULT 0;
11481154
",
11491155
migration_version,
11501156
)

0 commit comments

Comments
 (0)