mirror of
https://github.com/goauthentik/authentik
synced 2026-04-25 17:15:26 +02:00
lifecycle/migrate: add flag to skip migrations (#20863)
This commit is contained in:
committed by
GitHub
parent
b3dda80166
commit
db6ca79e37
@@ -183,3 +183,5 @@ storage:
|
||||
# backend: file # or s3
|
||||
# file: {}
|
||||
# s3: {}
|
||||
|
||||
skip_migrations: false
|
||||
|
||||
@@ -74,6 +74,8 @@ def release_lock(conn: Connection, cursor: Cursor):
|
||||
|
||||
|
||||
def run_migrations():
|
||||
if CONFIG.get_bool("skip_migrations", False):
|
||||
return
|
||||
conn_opts = CONFIG.get_dict_from_b64_json("postgresql.conn_options", default={})
|
||||
conn = connect(
|
||||
dbname=CONFIG.get("postgresql.name"),
|
||||
@@ -103,7 +105,7 @@ def run_migrations():
|
||||
if name != "Migration":
|
||||
continue
|
||||
migration = sub(curr, conn)
|
||||
curr.execute(f"SET search_path = {CONFIG.get("postgresql.default_schema")}")
|
||||
curr.execute(f"SET search_path = {CONFIG.get('postgresql.default_schema')}")
|
||||
if migration.needs_migration():
|
||||
LOGGER.info("Migration needs to be applied", migration=migration_path.name)
|
||||
migration.run()
|
||||
|
||||
@@ -673,6 +673,14 @@ Defaults to `60s`
|
||||
|
||||
Defaults to `120s`
|
||||
|
||||
## Advanced settings
|
||||
|
||||
##### `AUTHENTIK_SKIP_MIGRATIONS`
|
||||
|
||||
Whether to skip running migrations on starting authentik. This is destined to advanced setups and not recommended in normal use.
|
||||
|
||||
Defaults to `false`.
|
||||
|
||||
## System settings
|
||||
|
||||
Additional [system settings](../../sys-mgmt/settings.md) are configurable using the Admin interface, under **System** > **Settings** or using the API.
|
||||
|
||||
Reference in New Issue
Block a user