HomePhabricator
Diffusion Comm d20ac9605749

[native] Add pinned_count column to SQLite threads table

Description

[native] Add pinned_count column to SQLite threads table

Summary:
We need to add the pinned_count column to SQLite threads table, so when we (in the next diff) try to store pinnedCount in ThreadInfos, the ClientDB will have the pinned_count.

As mentioned in the test plan:

I'm not entirely sure if we really even need to consider a case where a new client will already have the column besides me in development work, so I can also just remove that check entirely and just add the column. I ran into this inconsistency while working off of my modified schema and running a migration on top of that

Part of https://linear.app/comm/issue/ENG-3396/store-the-number-of-pinned-messages-in-threadinfo

Depends on D7175

Test Plan:
Confirm the migration works

  1. git checkout master
  2. Build the app from xcode
  3. Connect to the SQLite database and confirm there is no pinned_count column
  4. git checkout pinned_messages
  5. Rebuild the app from xcode without deleting it
  6. Connect to the SQLite database and confirm the existence of a pinned_count column

Confirm the schema works

  1. git checkout pinned_messages
  2. Delete the app from the simulator
  3. Build the app from xcode
  4. Connect to the SQLite database and confirm the existence of a pinned_count column

Reviewers: atul, tomek, kamil

Reviewed By: atul, kamil

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D7202

Details