mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
This commit is contained in:
parent
b8ba89d077
commit
1fc8c15c08
2 changed files with 9 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ import android.app.NotificationChannel;
|
|||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import android.os.Build;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
|
@ -324,7 +325,12 @@ public class CommonsApplication extends MultiDexApplication {
|
|||
|
||||
CategoryDao.Table.onDelete(db);
|
||||
dbOpenHelper.deleteTable(db,CONTRIBUTIONS_TABLE);//Delete the contributions table in the existing db on older versions
|
||||
contributionDao.deleteAll();
|
||||
|
||||
try {
|
||||
contributionDao.deleteAll();
|
||||
} catch (SQLiteException e) {
|
||||
Timber.e(e);
|
||||
}
|
||||
BookmarkPicturesDao.Table.onDelete(db);
|
||||
BookmarkLocationsDao.Table.onDelete(db);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package fr.free.nrw.commons.contributions;
|
||||
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import androidx.paging.DataSource;
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
|
|
@ -68,7 +69,7 @@ public abstract class ContributionDao {
|
|||
public abstract Single<Integer> updateStates(int state, int[] toUpdateStates);
|
||||
|
||||
@Query("Delete FROM contribution")
|
||||
public abstract void deleteAll();
|
||||
public abstract void deleteAll() throws SQLiteException;
|
||||
|
||||
@Update
|
||||
public abstract void updateSynchronous(Contribution contribution);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue