digidem / comapeo-core

A local-first library for collaborating on mapping projects
MIT License
8 stars 1 forks source link

feat: rebuild SQLite when project migrations occur #949

Closed EvanHahn closed 3 weeks ago

EvanHahn commented 3 weeks ago

See #436.

awana-lockfile-bot[bot] commented 3 weeks ago

package-lock.json changes

Click to toggle table visibility
| Name | Status | Previous | Current | | :- | :-: | :-: | :-: | | `multi-core-indexer` | [UPDATED](#) | 1.0.0-alpha.10 | 1.0.0 |
EvanHahn commented 3 weeks ago

Ok looks good apart from one code clarity suggestion. However I think we should also include in this re-indexing of the projectSettingsTable (in MapeoManager) which I think needs the same treatment?

Done in 5084bb2e7d853861ca4fb39807c4d9d21761fb72. (I didn't have an easy way to test this so I didn't.)

Final thoughts, one way of doing this in the future would be to compare just the indexed tables in the sqlite_schema table, comparing the sql column, to detect changes. That way we would avoid re-indexing if we change the schema of a table that is not coming from our indexer.

That's a much better idea. I'll consider doing that in a followup.