mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
Support PostgreSQL Databases (#1617)
* Support PostgreSQL Databases * Set the database Schema * See if we can test postgres * Another test * Disable node container * Update database when changed * Simplify test workflow * Only exit on failed migrations * Run the first databaseUp sync * Map the port * Use absolute path for LD_PRELOAD * Timeout after 1m * Open the server in both database configurations * Only exit on migration failed in ci * Lint * Use new ServerConfig configuration
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package suwayomi.tachidesk.graphql.types
|
||||
|
||||
enum class DatabaseType {
|
||||
H2,
|
||||
POSTGRESQL,
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import kotlinx.coroutines.flow.mapLatest
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import org.jetbrains.exposed.sql.SortOrder
|
||||
import suwayomi.tachidesk.graphql.types.AuthMode
|
||||
import suwayomi.tachidesk.graphql.types.DatabaseType
|
||||
import suwayomi.tachidesk.graphql.types.DownloadConversion
|
||||
import suwayomi.tachidesk.graphql.types.KoreaderSyncChecksumMethod
|
||||
import suwayomi.tachidesk.graphql.types.KoreaderSyncStrategy
|
||||
@@ -636,6 +637,32 @@ class ServerConfig(
|
||||
requiresRestart = true,
|
||||
)
|
||||
|
||||
val databaseType: MutableStateFlow<DatabaseType> by EnumSetting(
|
||||
protoNumber = 69,
|
||||
group = SettingGroup.DATABASE,
|
||||
defaultValue = DatabaseType.H2,
|
||||
enumClass = DatabaseType::class,
|
||||
typeInfo = SettingsRegistry.PartialTypeInfo(imports = listOf("suwayomi.tachidesk.graphql.types.DatabaseType")),
|
||||
)
|
||||
|
||||
val databaseUrl: MutableStateFlow<String> by StringSetting(
|
||||
protoNumber = 70,
|
||||
group = SettingGroup.DATABASE,
|
||||
defaultValue = "postgresql://localhost:5432/suwayomi",
|
||||
)
|
||||
|
||||
val databaseUsername: MutableStateFlow<String> by StringSetting(
|
||||
protoNumber = 71,
|
||||
group = SettingGroup.DATABASE,
|
||||
defaultValue = "",
|
||||
)
|
||||
|
||||
val databasePassword: MutableStateFlow<String> by StringSetting(
|
||||
protoNumber = 72,
|
||||
group = SettingGroup.DATABASE,
|
||||
defaultValue = "",
|
||||
)
|
||||
|
||||
/** ****************************************************************** **/
|
||||
/** **/
|
||||
/** Renamed settings **/
|
||||
|
||||
@@ -4,6 +4,7 @@ enum class SettingGroup(
|
||||
val value: String,
|
||||
) {
|
||||
NETWORK("Network"),
|
||||
DATABASE("Database"),
|
||||
PROXY("Proxy"),
|
||||
WEB_UI("WebUI"),
|
||||
DOWNLOADER("Downloader"),
|
||||
|
||||
Reference in New Issue
Block a user