Also purge errors db when doing a rescan

This commit is contained in:
Lucas Verney 2016-04-06 18:58:13 +02:00
parent 287e1ab0f4
commit 3700905394

View File

@ -454,7 +454,7 @@ int main(int argc, char** argv) {
} }
// Purge db if a rescan is needed // Purge db if a rescan is needed
if (1 == args_info.rescan_flag) { if (1 == args_info.rescan_flag) {
dberr = sqlite3_exec(dbh, "BEGIN TRANSACTION; DELETE FROM distances; DELETE FROM songs; COMMIT", NULL, NULL, NULL); dberr = sqlite3_exec(dbh, "BEGIN TRANSACTION; DELETE FROM distances; DELETE FROM songs; DELETE FROM errors; COMMIT", NULL, NULL, NULL);
if (SQLITE_OK != dberr) { if (SQLITE_OK != dberr) {
fprintf(stderr, "Error purging existing data in db: %s.\n", sqlite3_errmsg(dbh)); fprintf(stderr, "Error purging existing data in db: %s.\n", sqlite3_errmsg(dbh));
return EXIT_FAILURE; return EXIT_FAILURE;