mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
Fix/m0045 prevent duplicated chapter pages migration (#1361)
* Fix "imageUrl" column name in migration * Rename column "imageUrl" to "IMAGE_URL" of table "Page"
This commit is contained in:
@@ -13,7 +13,7 @@ import org.jetbrains.exposed.sql.ReferenceOption
|
|||||||
object PageTable : IntIdTable() {
|
object PageTable : IntIdTable() {
|
||||||
val index = integer("index")
|
val index = integer("index")
|
||||||
val url = varchar("url", 2048)
|
val url = varchar("url", 2048)
|
||||||
val imageUrl = varchar("imageUrl", 2048).nullable()
|
val imageUrl = varchar("image_url", 2048).nullable()
|
||||||
|
|
||||||
val chapter = reference("chapter", ChapterTable, ReferenceOption.CASCADE)
|
val chapter = reference("chapter", ChapterTable, ReferenceOption.CASCADE)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ class M0045_PreventDuplicatedChapterPages : SQLMigration() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE PAGE
|
ALTER TABLE PAGE
|
||||||
ADD CONSTRAINT UC_PAGE UNIQUE (INDEX, imageUrl, CHAPTER)
|
ADD CONSTRAINT UC_PAGE UNIQUE (INDEX, "imageUrl", CHAPTER);
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package suwayomi.tachidesk.server.database.migration
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) Contributors to the Suwayomi project
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
import de.neonew.exposed.migrations.helpers.RenameFieldMigration
|
||||||
|
|
||||||
|
@Suppress("ClassName", "unused")
|
||||||
|
class M0046_RenamePageImageUrlColumn :
|
||||||
|
RenameFieldMigration(
|
||||||
|
"Page",
|
||||||
|
"\"imageUrl\"",
|
||||||
|
"image_url",
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user