mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03: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
|
# backend: file # or s3
|
||||||
# file: {}
|
# file: {}
|
||||||
# s3: {}
|
# s3: {}
|
||||||
|
|
||||||
|
skip_migrations: false
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ def release_lock(conn: Connection, cursor: Cursor):
|
|||||||
|
|
||||||
|
|
||||||
def run_migrations():
|
def run_migrations():
|
||||||
|
if CONFIG.get_bool("skip_migrations", False):
|
||||||
|
return
|
||||||
conn_opts = CONFIG.get_dict_from_b64_json("postgresql.conn_options", default={})
|
conn_opts = CONFIG.get_dict_from_b64_json("postgresql.conn_options", default={})
|
||||||
conn = connect(
|
conn = connect(
|
||||||
dbname=CONFIG.get("postgresql.name"),
|
dbname=CONFIG.get("postgresql.name"),
|
||||||
@@ -103,7 +105,7 @@ def run_migrations():
|
|||||||
if name != "Migration":
|
if name != "Migration":
|
||||||
continue
|
continue
|
||||||
migration = sub(curr, conn)
|
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():
|
if migration.needs_migration():
|
||||||
LOGGER.info("Migration needs to be applied", migration=migration_path.name)
|
LOGGER.info("Migration needs to be applied", migration=migration_path.name)
|
||||||
migration.run()
|
migration.run()
|
||||||
|
|||||||
@@ -673,6 +673,14 @@ Defaults to `60s`
|
|||||||
|
|
||||||
Defaults to `120s`
|
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
|
## System settings
|
||||||
|
|
||||||
Additional [system settings](../../sys-mgmt/settings.md) are configurable using the Admin interface, under **System** > **Settings** or using the API.
|
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