feat: add ability to skip migrations

This feature can be used in order to handle conflicting migrations
This commit is contained in:
2023-09-02 14:30:50 +03:00
parent 2c21ae26c3
commit d1132b49fc
5 changed files with 25 additions and 7 deletions

View File

@ -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",

View File

@ -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)