mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-24 21:39:54 +00:00
Mark Rowe
0b45772a0b
Add a test showing our behavior when migrating from an optional column to a required column.
Optional values are not automatically migrated to required columns since it is a lossy process. This test case revealed an issue where the number of objects can be lost if all properties of an object were optional and are all being migrated to required. This happens because the migration process removes the optional columns in a first pass, and recreates them as required in a second pass. Since this results in all columns being removed, we lose track of how many objects were stored. We avoid this by detecting the case where we are about to remove the last column and inserting a placeholder column that we'll remove after inserting the new columns.
Description
Languages
JavaScript
45.9%
C++
38.4%
Objective-C
3.9%
Shell
3.3%
Objective-C++
3.2%
Other
5.3%