Merge pull request #666 from AppFlowy-IO/workspace-settings-posteffects
chore: disabling indexing on workspace prunes collab embeddings
This commit is contained in:
commit
01f974beee
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM af_collab_embeddings e WHERE e.oid in (\n SELECT c.oid\n FROM af_collab c\n WHERE c.partition_key = e.partition_key\n AND c.oid = e.oid\n AND c.workspace_id = $1)",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Uuid"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "e5d51236e5c96ac91c70cd1d1b603f63e80e4f05a45a0790dd0bde892429ef14"
|
||||
}
|
||||
|
|
@ -814,6 +814,20 @@ pub async fn upsert_workspace_settings(
|
|||
.execute(tx.deref_mut())
|
||||
.await?;
|
||||
|
||||
if settings.disable_search_indexing {
|
||||
sqlx::query!(
|
||||
r#"DELETE FROM af_collab_embeddings e WHERE e.oid in (
|
||||
SELECT c.oid
|
||||
FROM af_collab c
|
||||
WHERE c.partition_key = e.partition_key
|
||||
AND c.oid = e.oid
|
||||
AND c.workspace_id = $1)"#,
|
||||
workspace_id
|
||||
)
|
||||
.execute(tx.deref_mut())
|
||||
.await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue