File tree 2 files changed +9
-2
lines changed
app/src/main/java/fr/free/nrw/commons
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 13
13
import android .app .NotificationManager ;
14
14
import android .content .Context ;
15
15
import android .database .sqlite .SQLiteDatabase ;
16
+ import android .database .sqlite .SQLiteException ;
16
17
import android .os .Build ;
17
18
import android .os .Process ;
18
19
import android .util .Log ;
@@ -324,7 +325,12 @@ private void updateAllDatabases() {
324
325
325
326
CategoryDao .Table .onDelete (db );
326
327
dbOpenHelper .deleteTable (db ,CONTRIBUTIONS_TABLE );//Delete the contributions table in the existing db on older versions
327
- contributionDao .deleteAll ();
328
+
329
+ try {
330
+ contributionDao .deleteAll ();
331
+ } catch (SQLiteException e ) {
332
+ Timber .e (e );
333
+ }
328
334
BookmarkPicturesDao .Table .onDelete (db );
329
335
BookmarkLocationsDao .Table .onDelete (db );
330
336
}
Original file line number Diff line number Diff line change 1
1
package fr .free .nrw .commons .contributions ;
2
2
3
+ import android .database .sqlite .SQLiteException ;
3
4
import androidx .paging .DataSource ;
4
5
import androidx .room .Dao ;
5
6
import androidx .room .Delete ;
@@ -68,7 +69,7 @@ public Completable delete(final Contribution contribution) {
68
69
public abstract Single <Integer > updateStates (int state , int [] toUpdateStates );
69
70
70
71
@ Query ("Delete FROM contribution" )
71
- public abstract void deleteAll ();
72
+ public abstract void deleteAll () throws SQLiteException ;
72
73
73
74
@ Update
74
75
public abstract void updateSynchronous (Contribution contribution );
You can’t perform that action at this time.
0 commit comments