Colpkg import now marks collection as modified

Addresses a corner case where a backup is imported into an
unchanged collection, resulting in the sync indicator showing a full
sync is required, which doesn't go away as syncing thinks no changes
are required.

An alternative way to solve this would be to reverse the order of checks
in the syncing code. It would have the advantage of retaining the
modification time of the backup, but any action like clicking on a deck
would cause it to be updated anyway, so I'm not sure that buys us much.
This commit is contained in:
Damien Elmes 2022-04-03 16:07:39 +10:00
parent 9ed12bb9d0
commit 4673fb5fe4

View File

@ -84,6 +84,7 @@ fn check_collection_and_mod_schema(col_path: &Path) -> Result<()> {
.ok() .ok()
.and_then(|mut col| { .and_then(|mut col| {
col.set_schema_modified().ok()?; col.set_schema_modified().ok()?;
col.set_modified().ok()?;
col.storage col.storage
.db .db
.pragma_query_value(None, "integrity_check", |row| row.get::<_, String>(0)) .pragma_query_value(None, "integrity_check", |row| row.get::<_, String>(0))