[Coffre Secrets] Connecteurs par reference ObsiGate, isolation workspace (Phase 4) #26
@@ -2076,3 +2076,31 @@ def _migration_draco_links(conn: sqlite3.Connection) -> None:
|
||||
)
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
@register(52, "coffre ObsiGate (Phase 4) : workspace_id + coffre_reference sur agent_connectors")
|
||||
def _migration_coffre_reference(conn: sqlite3.Connection) -> None:
|
||||
"""Migration 52 — références ObsiGate pour les connecteurs (issue #22).
|
||||
|
||||
* ``workspace_id`` : le connecteur appartient à un workspace (NULL =
|
||||
connecteur historique global, conservé tel quel — migration
|
||||
opportuniste, pas de big-bang).
|
||||
* ``coffre_reference`` : ``coffre:<slug>/<nom>`` (métadonnée, pas une
|
||||
valeur) ; vide = jeton chiffré local historique.
|
||||
Idempotente (gardée par ``columns()``), comme les migrations 32/34.
|
||||
"""
|
||||
cols = columns(conn, "agent_connectors")
|
||||
if "workspace_id" not in cols:
|
||||
conn.execute(
|
||||
"ALTER TABLE agent_connectors "
|
||||
"ADD COLUMN workspace_id INTEGER REFERENCES workspaces(id)"
|
||||
)
|
||||
if "coffre_reference" not in cols:
|
||||
conn.execute(
|
||||
"ALTER TABLE agent_connectors "
|
||||
"ADD COLUMN coffre_reference TEXT NOT NULL DEFAULT ''"
|
||||
)
|
||||
conn.execute(
|
||||
"CREATE INDEX IF NOT EXISTS idx_agent_connectors_workspace "
|
||||
"ON agent_connectors(workspace_id)"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user