mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-06 17:39:28 +02:00
transfer old fileds to new config
This commit is contained in:
@@ -21,6 +21,9 @@ branch_labels = None
|
|||||||
depends_on = None
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
PRESERVED_CONFIG_KEYS = ["comment_email_blacklist", "batch_size", "labels_to_skip"]
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
# Get all Jira connectors
|
# Get all Jira connectors
|
||||||
conn = op.get_bind()
|
conn = op.get_bind()
|
||||||
@@ -62,6 +65,9 @@ def upgrade() -> None:
|
|||||||
f"WARNING: Jira connector {connector_id} has no project URL configured"
|
f"WARNING: Jira connector {connector_id} has no project URL configured"
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
for old_key in PRESERVED_CONFIG_KEYS:
|
||||||
|
if old_key in old_config:
|
||||||
|
new_config[old_key] = old_config[old_key]
|
||||||
|
|
||||||
# Update the connector config
|
# Update the connector config
|
||||||
conn.execute(
|
conn.execute(
|
||||||
@@ -108,6 +114,10 @@ def downgrade() -> None:
|
|||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
for old_key in PRESERVED_CONFIG_KEYS:
|
||||||
|
if old_key in new_config:
|
||||||
|
old_config[old_key] = new_config[old_key]
|
||||||
|
|
||||||
# Update the connector config
|
# Update the connector config
|
||||||
conn.execute(
|
conn.execute(
|
||||||
sa.text(
|
sa.text(
|
||||||
|
Reference in New Issue
Block a user