mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2024-11-01 15:05:06 +01:00
fix #25
This commit is contained in:
parent
7157e07328
commit
a59f974537
@ -23,10 +23,9 @@ object DBMangaer {
|
||||
}
|
||||
|
||||
fun makeDataBaseTables() {
|
||||
// mention db object to connect
|
||||
DBMangaer.db
|
||||
// val db = DBMangaer.db
|
||||
// db.useNestedTransactions = true
|
||||
// must mention db object so the lazy block executes
|
||||
val db = DBMangaer.db
|
||||
db.useNestedTransactions = true
|
||||
|
||||
transaction {
|
||||
SchemaUtils.createMissingTablesAndColumns(
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ir.armor.tachidesk.util
|
||||
|
||||
import ir.armor.tachidesk.database.dataclass.CategoryDataClass
|
||||
import ir.armor.tachidesk.database.table.CategoryMangaTable
|
||||
import ir.armor.tachidesk.database.table.CategoryTable
|
||||
import ir.armor.tachidesk.database.table.toDataClass
|
||||
import org.jetbrains.exposed.sql.SortOrder
|
||||
@ -49,6 +50,9 @@ fun reorderCategory(categoryId: Int, from: Int, to: Int) {
|
||||
|
||||
fun removeCategory(categoryId: Int) {
|
||||
transaction {
|
||||
CategoryMangaTable.select { CategoryMangaTable.category eq categoryId }.forEach {
|
||||
removeMangaFromCategory(it[CategoryMangaTable.manga].value, categoryId)
|
||||
}
|
||||
CategoryTable.deleteWhere { CategoryTable.id eq categoryId }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user