Skip to content

Commit

Permalink
Fix selected_images_ni database migration
Browse files Browse the repository at this point in the history
In some case the database didsn't have such an index, so before removing it
we should check for that.
  • Loading branch information
jenshannoschwalm authored and TurboGit committed May 27, 2024
1 parent 646b4e8 commit 3f9ef28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -2809,7 +2809,7 @@ static int _upgrade_library_schema_step(dt_database_t *db, int version)
// As the selected_images table might have non-unique data the UNIQUE INDEX could fail,
// we avoid this by recreating both the table & index.
// minor downside: selection is lost while updating database sheme.
TRY_EXEC("DROP INDEX selected_images_ni",
TRY_EXEC("DROP INDEX IF EXISTS selected_images_ni",
"[init] can't drop index selected_images_ni\n");

TRY_EXEC("DROP TABLE selected_images",
Expand Down

0 comments on commit 3f9ef28

Please sign in to comment.