mig: drop the unused MCP collection tables

Merged
DA
6d ago
+20-180

Part of AIM-671.

Summary

  • Drops organization_mcp_collections, organization_mcp_collection_registries and organization_mcp_collection_server_attachments, along with their indexes, foreign keys and column comments.
  • Drops external_mcp_attachments.organization_mcp_collection_registry_id and its foreign key into the registries table. No query reads or writes the column.
  • Regenerates server/internal/database/models.go, which loses the three table structs and the column field.
  • The local project:reset task no longer touches the dropped attachments table.
  • The destructive statements carry -- atlas:nolint directives, as in earlier drop migrations. There is no atlas:assert: the rows are meant to be discarded.

Motivation

Collections were removed from the API and dashboard in #5938. The last reads went in #5943 (the registry link on external MCPs) and #7706 (the admin toolset page), and both are in released server versions. The remaining rows are orphaned data from that removed feature: in production, 128 collections, 128 collection registries and 64 server attachments, plus a small number of external MCP attachments that still point at a registry. They are dropped, not backed up.

This is split out from AIM-671 early because nothing reads these tables. The rest of AIM-671's column drops follow separately.

Lock note: dropping the tables briefly takes ACCESS EXCLUSIVE on the referenced parents (toolsets, mcp_servers, organization_metadata) to remove their FK triggers. This is the same pattern as the earlier assistant_toolsets drop, and the dropped tables are tiny.

šŸ¤– Generated with Claude Code


Summary by cubic

Part of AIM-671.

Drops the three unused MCP collection tables and the external_mcp_attachments.organization_mcp_collection_registry_id column that referenced one of them. Collections were removed from the API and dashboard, the last reads shipped in earlier server releases, and no remaining query touches these tables, so the orphaned rows are dropped rather than backed up.

This is split out early from AIM-671 because nothing reads these tables; the remaining column drops from that issue follow separately.

Dropping the tables briefly takes ACCESS EXCLUSIVE on the parent tables (toolsets, mcp_servers, organization_metadata) to remove their FK triggers, the same pattern as the earlier assistant_toolsets drop.

  • Regenerates server/internal/database/models.go and removes cleanup of the dropped tables from the local project:reset task.
  • Destructive statements carry atlas:nolint directives, with no atlas:assert since the rows are meant to be discarded.