Configure run/repair db migrations

Refs: #1517
This commit is contained in:
eikek
2022-05-22 00:07:36 +02:00
parent 79688c7711
commit 3764f9265b
14 changed files with 116 additions and 36 deletions

View File

@ -55,6 +55,20 @@ docspell.joex {
password = ""
}
# Additional settings related to schema migration.
database-schema = {
# Whether to run main database migrations.
run-main-migrations = true
# Whether to run the fixup migrations.
run-fixup-migrations = true
# Use with care. This repairs all migrations in the database by
# updating their checksums and removing failed migrations. Good
# for testing, not recommended for normal operation.
repair-schema = false
}
# Enable or disable debugging for e-mail related functionality. This
# applies to both sending and receiving mails. For security reasons
# logging is not very extensive on authentication failures. Setting

View File

@ -25,7 +25,7 @@ import docspell.joex.updatecheck.UpdateCheckConfig
import docspell.logging.LogConfig
import docspell.pubsub.naive.PubSubConfig
import docspell.scheduler.{PeriodicSchedulerConfig, SchedulerConfig}
import docspell.store.JdbcConfig
import docspell.store.{JdbcConfig, SchemaMigrateConfig}
case class Config(
appId: Ident,
@ -33,6 +33,7 @@ case class Config(
logging: LogConfig,
bind: Config.Bind,
jdbc: JdbcConfig,
databaseSchema: SchemaMigrateConfig,
scheduler: SchedulerConfig,
periodicScheduler: PeriodicSchedulerConfig,
userTasks: Config.UserTasks,

View File

@ -41,6 +41,7 @@ object JoexServer {
store <- Store.create[F](
cfg.jdbc,
cfg.databaseSchema,
cfg.files.defaultFileRepositoryConfig,
pools.connectEC
)