mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-18 20:10:58 +02:00
fix index attempt migration where no credential ID
This commit is contained in:
parent
3938a053aa
commit
e4b1f5b963
@ -35,9 +35,18 @@ def upgrade() -> None:
|
|||||||
op.execute(
|
op.execute(
|
||||||
"""
|
"""
|
||||||
UPDATE index_attempt ia
|
UPDATE index_attempt ia
|
||||||
SET connector_credential_pair_id = ccp.id
|
SET connector_credential_pair_id =
|
||||||
FROM connector_credential_pair ccp
|
CASE
|
||||||
WHERE ia.connector_id = ccp.connector_id AND ia.credential_id = ccp.credential_id
|
WHEN ia.credential_id IS NULL THEN
|
||||||
|
(SELECT id FROM connector_credential_pair
|
||||||
|
WHERE connector_id = ia.connector_id
|
||||||
|
LIMIT 1)
|
||||||
|
ELSE
|
||||||
|
(SELECT id FROM connector_credential_pair
|
||||||
|
WHERE connector_id = ia.connector_id
|
||||||
|
AND credential_id = ia.credential_id)
|
||||||
|
END
|
||||||
|
WHERE ia.connector_id IS NOT NULL
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user