mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-01 02:31:36 -05:00
[db] Clarify method documentation for clearing/resetting
This commit is contained in:
@@ -592,6 +592,11 @@ internal interface AppDaoInt : AppDao {
|
||||
@Query("SELECT COUNT(*) FROM ${LocalizedFileList.TABLE}")
|
||||
fun countLocalizedFileLists(): Int
|
||||
|
||||
/**
|
||||
* Removes all apps and associated data such as versions from the database.
|
||||
* Careful: Doing this without other measures such as calling [RepositoryDaoInt.resetTimestamps]
|
||||
* will cause application of diffs to fail.
|
||||
*/
|
||||
@Query("DELETE FROM ${AppMetadata.TABLE}")
|
||||
fun clearAll()
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.fdroid.database.DbDiffUtils.diffAndUpdateListTable
|
||||
import org.fdroid.database.DbDiffUtils.diffAndUpdateTable
|
||||
import org.fdroid.index.IndexFormatVersion
|
||||
import org.fdroid.index.IndexParser.json
|
||||
import org.fdroid.index.v2.IndexV2Updater
|
||||
import org.fdroid.index.v2.MirrorV2
|
||||
import org.fdroid.index.v2.ReflectionDiffer.applyDiff
|
||||
import org.fdroid.index.v2.RepoV2
|
||||
@@ -380,7 +381,8 @@ internal interface RepositoryDaoInt : RepositoryDao {
|
||||
|
||||
/**
|
||||
* Resets timestamps for *all* repos in the database.
|
||||
* This will cause
|
||||
* This will use a full index instead of diffs
|
||||
* when updating the repository via [IndexV2Updater].
|
||||
*/
|
||||
@Query("UPDATE ${CoreRepository.TABLE} SET timestamp = -1")
|
||||
fun resetTimestamps()
|
||||
|
||||
Reference in New Issue
Block a user