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.
This commit is contained in:
KaiserBh
2023-07-11 05:52:57 +10:00
committed by GitHub
parent d0f52ea93d
commit a577f5534f
13 changed files with 139 additions and 16 deletions

View File

@ -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,
)
}
}

View File

@ -24,6 +24,8 @@ data class Manga(
val thumbnailUrl: String?,
val updateStrategy: UpdateStrategy,
val initialized: Boolean,
val lastModifiedAt: Long,
val favoriteModifiedAt: Long?,
) : Serializable {
val sorting: Long
@ -109,6 +111,8 @@ data class Manga(
thumbnailUrl = null,
updateStrategy = UpdateStrategy.ALWAYS_UPDATE,
initialized = false,
lastModifiedAt = 0L,
favoriteModifiedAt = 0L,
)
}
}