Database changes to support library syncing (#9683)

* feat: added migrations.

* feat: create triggers, account for new installs.

* feat: update mappers to include the new field.

* feat: update backupManga and backupChapter.

Include the new fields to be backed up as well.

* feat: add sql query to fetch all manga with `last_favorited_at` field.

* feat: version bump.

* chore: revert and refactor.

* chore: forgot to lower case the field name.

* chore: added getAllManga query as well renamed `fetchMangaWithLastFavorite` to `getMangasWithFavoriteTimestamp`

* chore: oops that's not meant to be there.

* feat: back fill and set last_modified_at to not null.

* chore: remove redundant triggers.

* fix: build error, accidentally removed insert.

* fix: build error, accidentally removed insert.

* refactor: review pointer, make fields not null.

(cherry picked from commit a577f5534f31086174b1cc851d8b489d69f557e8)

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupManga.kt
#	data/src/main/java/tachiyomi/data/manga/MangaMapper.kt
#	data/src/main/sqldelight/tachiyomi/data/mangas.sq
#	data/src/main/sqldelight/tachiyomi/migrations/25.sqm
#	domain/src/main/java/tachiyomi/domain/manga/model/Manga.kt
This commit is contained in:
KaiserBh
2023-07-11 05:52:57 +10:00
committed by Jobobby04
parent bf4464deac
commit 1cb34adb01
15 changed files with 148 additions and 22 deletions
@@ -13,6 +13,7 @@ data class Chapter(
val dateUpload: Long,
val chapterNumber: Float,
val scanlator: String?,
val lastModifiedAt: Long,
) {
val isRecognizedNumber: Boolean
get() = chapterNumber >= 0f
@@ -31,6 +32,7 @@ data class Chapter(
dateUpload = -1,
chapterNumber = -1f,
scanlator = null,
lastModifiedAt = 0,
)
}
}
@@ -28,6 +28,8 @@ data class Manga(
val thumbnailUrl: String?,
val updateStrategy: UpdateStrategy,
val initialized: Boolean,
val lastModifiedAt: Long,
val favoriteModifiedAt: Long?,
// SY -->
val filteredScanlators: List<String>?,
// SY <--
@@ -146,6 +148,8 @@ data class Manga(
thumbnailUrl = null,
updateStrategy = UpdateStrategy.ALWAYS_UPDATE,
initialized = false,
lastModifiedAt = 0L,
favoriteModifiedAt = 0L,
// SY -->
filteredScanlators = null,
// SY <--