Skip to content

Collector migration 12 skips the base table, against the documented convention #504

Description

@dpage

Noticed whilst landing #476.

.claude/golang-expert/notification-channels.md states that a column added by a
migration must also be added to the CREATE TABLE in collector/src/database/schema.go,
so that a fresh install gets the final shape from migration 1 rather than depending on a
later migration's ALTER/DROP CONSTRAINT IF EXISTS path, which is the more fragile of
the two.

Migration 12 from #384 (query_id on metrics.pg_stat_activity) does not do this: the
partitioned parent's CREATE TABLE has no query_id column, so fresh installs get it
only via the migration. #476 restored the equivalent base-table change for its own
migration 14, which is what surfaced the difference.

So the convention is currently applied inconsistently in the tree, and one of two things
should happen: either add the column to the base table for migration 12, or drop the
convention from the knowledge base and say plainly that migrations alone define the
final shape. A knowledge-base entry that the code contradicts is the outcome worth
avoiding either way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions