Page MenuHomePhabricator

[native/sqlite] add `IF NOT EXISTS` constraint to migrations
ClosedPublic

Authored by kamil on Oct 4 2022, 2:07 AM.
Tags
None
Referenced Files
F3342288: D5290.diff
Fri, Nov 22, 1:07 AM
Unknown Object (File)
Sun, Nov 3, 12:36 AM
Unknown Object (File)
Sun, Nov 3, 12:36 AM
Unknown Object (File)
Sun, Nov 3, 12:36 AM
Unknown Object (File)
Sun, Nov 3, 12:35 AM
Unknown Object (File)
Sun, Nov 3, 12:29 AM
Unknown Object (File)
Sep 26 2024, 10:16 PM
Unknown Object (File)
Sep 26 2024, 10:16 PM

Details

Summary

More context in this linear task with bug description.

This diff allows running all migration multiple times without crashing.

Test Plan
  1. This reproduce plan
  2. Comment this line and reload app twice (without logout to check if this works on the same database instance)

Diff Detail

Repository
rCOMM Comm
Branch
add-not-exists
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil edited the test plan for this revision. (Show Details)
kamil added reviewers: atul, marcin.
kamil added a subscriber: max.
kamil published this revision for review.Oct 4 2022, 3:00 AM
kamil edited the summary of this revision. (Show Details)
tomek added inline comments.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
144

Can we add IF NOT EXISTS also here?

This revision is now accepted and ready to land.Oct 4 2022, 4:31 AM
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
144

In theory, it's not needed.

First, table is dropped, then re-create and after this indexed is created so it won't fail, but I agree can be added just for clarity, will do!

add IF NOT EXISTS for messages_idx_thread_time