mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-10 04:25:47 +00:00
feat: add ability to skip migrations
This feature can be used in order to handle conflicting migrations
This commit is contained in:
@ -30,17 +30,21 @@ CONFIGURATION_SCHEMA: ConfigurationSchema = {
|
||||
"settings": {
|
||||
"type": "dict",
|
||||
"schema": {
|
||||
"include": {
|
||||
"type": "path",
|
||||
"coerce": "absolute_path",
|
||||
"required": True,
|
||||
"path_exists": True,
|
||||
"apply_migrations": {
|
||||
"type": "boolean",
|
||||
"coerce": "boolean",
|
||||
},
|
||||
"database": {
|
||||
"type": "path",
|
||||
"coerce": "absolute_path",
|
||||
"required": True,
|
||||
},
|
||||
"include": {
|
||||
"type": "path",
|
||||
"coerce": "absolute_path",
|
||||
"required": True,
|
||||
"path_exists": True,
|
||||
},
|
||||
"logging": {
|
||||
"type": "path",
|
||||
"coerce": "absolute_path",
|
||||
|
@ -87,5 +87,6 @@ class SQLite(AuthOperations, BuildOperations, LogsOperations, PackageOperations,
|
||||
|
||||
paths = configuration.repository_paths
|
||||
|
||||
self.with_connection(lambda connection: Migrations.migrate(connection, configuration))
|
||||
if configuration.getboolean("settings", "apply_migrations", fallback=True):
|
||||
self.with_connection(lambda connection: Migrations.migrate(connection, configuration))
|
||||
paths.chown(self.path)
|
||||
|
Reference in New Issue
Block a user