mirror of
https://github.com/gotson/komga.git
synced 2026-01-03 06:16:34 +01:00
refactor: change book number from float to int
This commit is contained in:
parent
f6fcb97446
commit
02700df0d9
4 changed files with 6 additions and 4 deletions
|
|
@ -54,8 +54,8 @@ class Book(
|
|||
@JoinColumn(name = "media_id", nullable = false)
|
||||
var media: Media = Media()
|
||||
|
||||
@Column(name = "number", nullable = false, columnDefinition = "REAL")
|
||||
var number: Float = 0F
|
||||
@Column(name = "number", nullable = false)
|
||||
var number: Int = 0
|
||||
|
||||
fun fileName(): String = FilenameUtils.getName(url.toString())
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class Series(
|
|||
_books.clear()
|
||||
value.forEach { it.series = this }
|
||||
_books.addAll(value.sortedWith(compareBy(natSortComparator) { it.name }))
|
||||
_books.forEachIndexed { index, book -> book.number = index + 1F }
|
||||
_books.forEachIndexed { index, book -> book.number = index + 1 }
|
||||
}
|
||||
|
||||
@OneToOne(optional = false, orphanRemoval = true, cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ data class BookDto(
|
|||
val seriesId: Long,
|
||||
val name: String,
|
||||
val url: String,
|
||||
val number: Float,
|
||||
val number: Int,
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||
val created: LocalDateTime?,
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
alter table book
|
||||
alter column number set data type int;
|
||||
Loading…
Reference in a new issue