mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-01-11 16:29:08 +01:00
move databse to server package, move tables to a better place
This commit is contained in:
parent
921a0a3361
commit
e8d41f83c2
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database
|
||||
package suwayomi.server.database
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
@ -12,8 +12,8 @@ import org.kodein.di.DI
|
||||
import org.kodein.di.conf.global
|
||||
import org.kodein.di.instance
|
||||
import suwayomi.server.ApplicationDirs
|
||||
import suwayomi.tachidesk.model.database.migration.lib.loadMigrationsFrom
|
||||
import suwayomi.tachidesk.model.database.migration.lib.runMigrations
|
||||
import suwayomi.server.database.migration.lib.loadMigrationsFrom
|
||||
import suwayomi.server.database.migration.lib.runMigrations
|
||||
|
||||
object DBManager {
|
||||
val db by lazy {
|
||||
@ -27,6 +27,6 @@ fun databaseUp() {
|
||||
val db = DBManager.db
|
||||
db.useNestedTransactions = true
|
||||
|
||||
val migrations = loadMigrationsFrom("suwayomi.tachidesk.model.database.migration")
|
||||
val migrations = loadMigrationsFrom("suwayomi.server.database.migration")
|
||||
runMigrations(migrations)
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.migration
|
||||
package suwayomi.server.database.migration
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
@ -12,7 +12,7 @@ import org.jetbrains.exposed.dao.id.IdTable
|
||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
||||
import org.jetbrains.exposed.sql.SchemaUtils
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import suwayomi.tachidesk.model.database.migration.lib.Migration
|
||||
import suwayomi.server.database.migration.lib.Migration
|
||||
|
||||
@Suppress("ClassName", "unused")
|
||||
class M0001_Initial : Migration() {
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.migration
|
||||
package suwayomi.server.database.migration
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
@ -9,7 +9,7 @@ package suwayomi.tachidesk.model.database.migration
|
||||
|
||||
import org.jetbrains.exposed.sql.transactions.TransactionManager
|
||||
import org.jetbrains.exposed.sql.vendors.currentDialect
|
||||
import suwayomi.tachidesk.model.database.migration.lib.Migration
|
||||
import suwayomi.server.database.migration.lib.Migration
|
||||
|
||||
@Suppress("ClassName", "unused")
|
||||
class M0002_ChapterTableIndexRename : Migration() {
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.migration
|
||||
package suwayomi.server.database.migration
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
@ -9,7 +9,7 @@ package suwayomi.tachidesk.model.database.migration
|
||||
|
||||
import org.jetbrains.exposed.sql.transactions.TransactionManager
|
||||
import org.jetbrains.exposed.sql.vendors.currentDialect
|
||||
import suwayomi.tachidesk.model.database.migration.lib.Migration
|
||||
import suwayomi.server.database.migration.lib.Migration
|
||||
|
||||
@Suppress("ClassName", "unused")
|
||||
class M0003_DefaultCategory : Migration() {
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.migration.lib
|
||||
package suwayomi.server.database.migration.lib
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.migration.lib
|
||||
package suwayomi.server.database.migration.lib
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.migration.lib
|
||||
package suwayomi.server.database.migration.lib
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
@ -63,7 +63,7 @@ fun runMigrations(migrations: List<Migration>, database: Database = TransactionM
|
||||
|
||||
@OptIn(ExperimentalPathApi::class)
|
||||
private fun getTopLevelClasses(packageName: String): List<Class<*>> {
|
||||
ServerConfig::class.java.getResource("/" + "suwayomi.tachidesk.model.database.migration".replace('.', '/'))
|
||||
ServerConfig::class.java.getResource("/" + "suwayomi.server.database.migration".replace('.', '/'))
|
||||
val path = "/" + packageName.replace('.', '/')
|
||||
val uri = ServerConfig::class.java.getResource(path).toURI()
|
||||
|
@ -15,9 +15,9 @@ import org.jetbrains.exposed.sql.selectAll
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import org.jetbrains.exposed.sql.update
|
||||
import suwayomi.tachidesk.impl.CategoryManga.removeMangaFromCategory
|
||||
import suwayomi.tachidesk.model.database.table.CategoryMangaTable
|
||||
import suwayomi.tachidesk.model.database.table.CategoryTable
|
||||
import suwayomi.tachidesk.model.database.table.toDataClass
|
||||
import suwayomi.tachidesk.model.table.CategoryMangaTable
|
||||
import suwayomi.tachidesk.model.table.CategoryTable
|
||||
import suwayomi.tachidesk.model.table.toDataClass
|
||||
import suwayomi.tachidesk.model.dataclass.CategoryDataClass
|
||||
|
||||
object Category {
|
||||
|
@ -14,10 +14,10 @@ import org.jetbrains.exposed.sql.insert
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import org.jetbrains.exposed.sql.update
|
||||
import suwayomi.tachidesk.model.database.table.CategoryMangaTable
|
||||
import suwayomi.tachidesk.model.database.table.CategoryTable
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.database.table.toDataClass
|
||||
import suwayomi.tachidesk.model.table.CategoryMangaTable
|
||||
import suwayomi.tachidesk.model.table.CategoryTable
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.toDataClass
|
||||
import suwayomi.tachidesk.model.dataclass.CategoryDataClass
|
||||
import suwayomi.tachidesk.model.dataclass.MangaDataClass
|
||||
|
||||
|
@ -19,10 +19,10 @@ import org.jetbrains.exposed.sql.update
|
||||
import suwayomi.tachidesk.impl.Manga.getManga
|
||||
import suwayomi.tachidesk.impl.util.GetHttpSource.getHttpSource
|
||||
import suwayomi.tachidesk.impl.util.lang.awaitSingle
|
||||
import suwayomi.tachidesk.model.database.table.ChapterTable
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.database.table.PageTable
|
||||
import suwayomi.tachidesk.model.database.table.toDataClass
|
||||
import suwayomi.tachidesk.model.table.ChapterTable
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.PageTable
|
||||
import suwayomi.tachidesk.model.table.toDataClass
|
||||
import suwayomi.tachidesk.model.dataclass.ChapterDataClass
|
||||
|
||||
object Chapter {
|
||||
|
@ -14,10 +14,10 @@ import org.jetbrains.exposed.sql.select
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import org.jetbrains.exposed.sql.update
|
||||
import suwayomi.tachidesk.impl.Manga.getManga
|
||||
import suwayomi.tachidesk.model.database.table.CategoryMangaTable
|
||||
import suwayomi.tachidesk.model.database.table.CategoryTable
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.database.table.toDataClass
|
||||
import suwayomi.tachidesk.model.table.CategoryMangaTable
|
||||
import suwayomi.tachidesk.model.table.CategoryTable
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.toDataClass
|
||||
import suwayomi.tachidesk.model.dataclass.MangaDataClass
|
||||
|
||||
object Library {
|
||||
|
@ -23,8 +23,8 @@ import suwayomi.tachidesk.impl.util.lang.awaitSingle
|
||||
import suwayomi.tachidesk.impl.util.network.await
|
||||
import suwayomi.tachidesk.impl.util.storage.CachedImageResponse.clearCachedImage
|
||||
import suwayomi.tachidesk.impl.util.storage.CachedImageResponse.getCachedImageResponse
|
||||
import suwayomi.tachidesk.model.database.table.MangaStatus
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.MangaStatus
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
import suwayomi.tachidesk.model.dataclass.MangaDataClass
|
||||
import java.io.InputStream
|
||||
|
||||
|
@ -13,8 +13,8 @@ import org.jetbrains.exposed.sql.select
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import suwayomi.tachidesk.impl.util.GetHttpSource.getHttpSource
|
||||
import suwayomi.tachidesk.impl.util.lang.awaitSingle
|
||||
import suwayomi.tachidesk.model.database.table.MangaStatus
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.MangaStatus
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
import suwayomi.tachidesk.model.dataclass.MangaDataClass
|
||||
import suwayomi.tachidesk.model.dataclass.PagedMangaListDataClass
|
||||
|
||||
|
@ -21,9 +21,9 @@ import suwayomi.tachidesk.impl.util.GetHttpSource.getHttpSource
|
||||
import suwayomi.tachidesk.impl.util.lang.awaitSingle
|
||||
import suwayomi.tachidesk.impl.util.storage.CachedImageResponse.getCachedImageResponse
|
||||
import suwayomi.tachidesk.impl.util.storage.SafePath
|
||||
import suwayomi.tachidesk.model.database.table.ChapterTable
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.database.table.PageTable
|
||||
import suwayomi.tachidesk.model.table.ChapterTable
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.PageTable
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
|
||||
|
@ -13,8 +13,8 @@ import org.jetbrains.exposed.sql.selectAll
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import suwayomi.tachidesk.impl.extension.Extension.getExtensionIconUrl
|
||||
import suwayomi.tachidesk.impl.util.GetHttpSource.getHttpSource
|
||||
import suwayomi.tachidesk.model.database.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.database.table.SourceTable
|
||||
import suwayomi.tachidesk.model.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.table.SourceTable
|
||||
import suwayomi.tachidesk.model.dataclass.SourceDataClass
|
||||
|
||||
object Source {
|
||||
|
@ -24,8 +24,8 @@ import suwayomi.tachidesk.impl.backup.models.ChapterImpl
|
||||
import suwayomi.tachidesk.impl.backup.models.Manga
|
||||
import suwayomi.tachidesk.impl.backup.models.MangaImpl
|
||||
import suwayomi.tachidesk.impl.util.GetHttpSource.getHttpSource
|
||||
import suwayomi.tachidesk.model.database.table.ChapterTable
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.ChapterTable
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
|
||||
object LegacyBackupExport : LegacyBackupBase() {
|
||||
|
||||
|
@ -28,7 +28,7 @@ import suwayomi.tachidesk.impl.backup.models.Track
|
||||
import suwayomi.tachidesk.impl.backup.models.TrackImpl
|
||||
import suwayomi.tachidesk.impl.util.GetHttpSource.getHttpSource
|
||||
import suwayomi.tachidesk.impl.util.lang.awaitSingle
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
import java.io.InputStream
|
||||
import java.util.Date
|
||||
|
||||
|
@ -11,7 +11,7 @@ import com.google.gson.JsonObject
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import suwayomi.tachidesk.impl.backup.legacy.models.Backup
|
||||
import suwayomi.tachidesk.model.database.table.SourceTable
|
||||
import suwayomi.tachidesk.model.table.SourceTable
|
||||
|
||||
object LegacyBackupValidator {
|
||||
data class ValidationResult(val missingSources: List<String>, val missingTrackers: List<String>)
|
||||
|
@ -1,7 +1,7 @@
|
||||
package suwayomi.tachidesk.impl.backup.models
|
||||
|
||||
import org.jetbrains.exposed.sql.ResultRow
|
||||
import suwayomi.tachidesk.model.database.table.ChapterTable
|
||||
import suwayomi.tachidesk.model.table.ChapterTable
|
||||
|
||||
class ChapterImpl : Chapter {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package suwayomi.tachidesk.impl.backup.models
|
||||
|
||||
import org.jetbrains.exposed.sql.ResultRow
|
||||
import suwayomi.tachidesk.model.database.table.MangaTable
|
||||
import suwayomi.tachidesk.model.table.MangaTable
|
||||
|
||||
open class MangaImpl : Manga {
|
||||
|
||||
|
@ -40,8 +40,8 @@ import suwayomi.tachidesk.impl.util.PackageTools.loadExtensionSources
|
||||
import suwayomi.tachidesk.impl.util.PackageTools.trustedSignatures
|
||||
import suwayomi.tachidesk.impl.util.network.await
|
||||
import suwayomi.tachidesk.impl.util.storage.CachedImageResponse.getCachedImageResponse
|
||||
import suwayomi.tachidesk.model.database.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.database.table.SourceTable
|
||||
import suwayomi.tachidesk.model.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.table.SourceTable
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
|
@ -17,7 +17,7 @@ import org.jetbrains.exposed.sql.update
|
||||
import suwayomi.tachidesk.impl.extension.Extension.getExtensionIconUrl
|
||||
import suwayomi.tachidesk.impl.extension.github.ExtensionGithubApi
|
||||
import suwayomi.tachidesk.impl.extension.github.OnlineExtension
|
||||
import suwayomi.tachidesk.model.database.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.dataclass.ExtensionDataClass
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
|
@ -17,8 +17,8 @@ import org.kodein.di.conf.global
|
||||
import org.kodein.di.instance
|
||||
import suwayomi.server.ApplicationDirs
|
||||
import suwayomi.tachidesk.impl.util.PackageTools.loadExtensionSources
|
||||
import suwayomi.tachidesk.model.database.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.database.table.SourceTable
|
||||
import suwayomi.tachidesk.model.table.ExtensionTable
|
||||
import suwayomi.tachidesk.model.table.SourceTable
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object GetHttpSource {
|
||||
|
@ -7,7 +7,7 @@ package suwayomi.tachidesk.model.dataclass
|
||||
* 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 suwayomi.tachidesk.model.database.table.MangaStatus
|
||||
import suwayomi.tachidesk.model.table.MangaStatus
|
||||
|
||||
data class MangaDataClass(
|
||||
val id: Int,
|
||||
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.table
|
||||
package suwayomi.tachidesk.model.table
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.table
|
||||
package suwayomi.tachidesk.model.table
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.table
|
||||
package suwayomi.tachidesk.model.table
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.table
|
||||
package suwayomi.tachidesk.model.table
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.table
|
||||
package suwayomi.tachidesk.model.table
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.source.model.SManga
|
||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
||||
import org.jetbrains.exposed.sql.ResultRow
|
||||
import suwayomi.tachidesk.impl.MangaList.proxyThumbnailUrl
|
||||
import suwayomi.tachidesk.model.database.table.MangaStatus.Companion
|
||||
import suwayomi.tachidesk.model.table.MangaStatus.Companion
|
||||
import suwayomi.tachidesk.model.dataclass.MangaDataClass
|
||||
|
||||
object MangaTable : IntIdTable() {
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.table
|
||||
package suwayomi.tachidesk.model.table
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.model.database.table
|
||||
package suwayomi.tachidesk.model.table
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
Loading…
x
Reference in New Issue
Block a user