kin: KIN-INFRA-010 Исправить link_type vs type: frontend отправляет неверное поле в API
This commit is contained in:
parent
b973b9219a
commit
40e1001cea
1 changed files with 17 additions and 0 deletions
17
core/db.py
17
core/db.py
|
|
@ -719,6 +719,23 @@ def _migrate(conn: sqlite3.Connection):
|
|||
)
|
||||
conn.commit()
|
||||
|
||||
# Create indexes for project_links (KIN-INFRA-008).
|
||||
# Guard: indexes must be created AFTER the table exists.
|
||||
if "project_links" in existing_tables:
|
||||
existing_indexes = {r[0] for r in conn.execute(
|
||||
"SELECT name FROM sqlite_master WHERE type='index'"
|
||||
).fetchall()}
|
||||
if "idx_project_links_to" not in existing_indexes:
|
||||
conn.execute(
|
||||
"CREATE INDEX IF NOT EXISTS idx_project_links_to ON project_links(to_project)"
|
||||
)
|
||||
conn.commit()
|
||||
if "idx_project_links_from" not in existing_indexes:
|
||||
conn.execute(
|
||||
"CREATE INDEX IF NOT EXISTS idx_project_links_from ON project_links(from_project)"
|
||||
)
|
||||
conn.commit()
|
||||
|
||||
|
||||
def _seed_default_hooks(conn: sqlite3.Connection):
|
||||
"""Seed default hooks for the kin project (idempotent).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue