mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 18:36:23 +02:00
feat: deactivate legacy Obsidian connectors and implement partial unique index for improved upsert handling
This commit is contained in:
parent
4d3406341d
commit
2d90ed0fec
8 changed files with 683 additions and 145 deletions
|
|
@ -1510,6 +1510,18 @@ class SearchSourceConnector(BaseModel, TimestampMixin):
|
|||
"name",
|
||||
name="uq_searchspace_user_connector_type_name",
|
||||
),
|
||||
# Mirrors migration 129; backs the ``/obsidian/connect`` upsert.
|
||||
Index(
|
||||
"search_source_connectors_obsidian_plugin_vault_uniq",
|
||||
"user_id",
|
||||
text("(config->>'vault_id')"),
|
||||
unique=True,
|
||||
postgresql_where=text(
|
||||
"connector_type = 'OBSIDIAN_CONNECTOR' "
|
||||
"AND config->>'source' = 'plugin' "
|
||||
"AND config->>'vault_id' IS NOT NULL"
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
name = Column(String(100), nullable=False, index=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue