From c874bbc57b76ee81b1799fe133b34ad0e33a7e77 Mon Sep 17 00:00:00 2001 From: J Date: Tue, 23 Jun 2026 12:10:08 +0800 Subject: [PATCH] fix(channel): renumber generalization migration 123 -> 124 main merged 123_issue_stage after this branch forked, so the branch's 123_channel_generalization now collides on the migration number. The runner keys schema_migrations by full version string and would still apply both, but a duplicate number is a merge hazard and convention violation, so move the channel migration to the next free slot (124). issue_stage (ALTER issue ADD COLUMN stage) and the channel generalization touch disjoint tables; verified on PG17 that 123_issue_stage applies cleanly on a DB already carrying 124_channel_generalization, so the two are order-independent. sqlc regenerated (v1.31.1): only the migration-number comment changed. MUL-3515 Co-authored-by: multica-agent --- ...alization.down.sql => 124_channel_generalization.down.sql} | 2 +- ...eneralization.up.sql => 124_channel_generalization.up.sql} | 0 server/pkg/db/generated/channel.sql.go | 4 ++-- server/pkg/db/queries/channel.sql | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename server/migrations/{123_channel_generalization.down.sql => 124_channel_generalization.down.sql} (87%) rename server/migrations/{123_channel_generalization.up.sql => 124_channel_generalization.up.sql} (100%) diff --git a/server/migrations/123_channel_generalization.down.sql b/server/migrations/124_channel_generalization.down.sql similarity index 87% rename from server/migrations/123_channel_generalization.down.sql rename to server/migrations/124_channel_generalization.down.sql index bda9d3cfd4..73e87a5f3e 100644 --- a/server/migrations/123_channel_generalization.down.sql +++ b/server/migrations/124_channel_generalization.down.sql @@ -1,4 +1,4 @@ --- Reverse 123_channel_generalization.up.sql. The lark_* tables were left +-- Reverse 124_channel_generalization.up.sql. The lark_* tables were left -- in place by the up migration, so rolling back only needs to drop the -- channel_* tables that were added. DROP TABLE IF EXISTS channel_binding_token; diff --git a/server/migrations/123_channel_generalization.up.sql b/server/migrations/124_channel_generalization.up.sql similarity index 100% rename from server/migrations/123_channel_generalization.up.sql rename to server/migrations/124_channel_generalization.up.sql diff --git a/server/pkg/db/generated/channel.sql.go b/server/pkg/db/generated/channel.sql.go index 75264e39c7..c3f7937633 100644 --- a/server/pkg/db/generated/channel.sql.go +++ b/server/pkg/db/generated/channel.sql.go @@ -97,7 +97,7 @@ type ClaimChannelInboundDedupParams struct { // claim is acquired (fresh insert, or stale-reclaim of an in-flight claim // older than 60s); returns no rows when terminal (processed) or actively // in-flight. Every claim mints a fresh claim_token; Mark/Release are -// fenced on it. See the table comment in migration 123 / the lark +// fenced on it. See the table comment in migration 124 / the lark // predecessor for the full invariant set. func (q *Queries) ClaimChannelInboundDedup(ctx context.Context, arg ClaimChannelInboundDedupParams) (ChannelInboundMessageDedup, error) { row := q.db.QueryRow(ctx, claimChannelInboundDedup, arg.InstallationID, arg.MessageID) @@ -933,7 +933,7 @@ type UpsertChannelInstallationParams struct { } // Platform-agnostic inbound channel queries (MUL-3515). These operate on -// the channel_* tables created in migration 123. Each installation carries +// the channel_* tables created in migration 124. Each installation carries // a `channel_type` discriminator and a JSONB `config` blob for // platform-specific identifiers/credentials; the cross-platform columns // stay flat. The Go layer owns building/parsing config — these queries diff --git a/server/pkg/db/queries/channel.sql b/server/pkg/db/queries/channel.sql index bab236b766..3b34f58ae2 100644 --- a/server/pkg/db/queries/channel.sql +++ b/server/pkg/db/queries/channel.sql @@ -1,5 +1,5 @@ -- Platform-agnostic inbound channel queries (MUL-3515). These operate on --- the channel_* tables created in migration 123. Each installation carries +-- the channel_* tables created in migration 124. Each installation carries -- a `channel_type` discriminator and a JSONB `config` blob for -- platform-specific identifiers/credentials; the cross-platform columns -- stay flat. The Go layer owns building/parsing config — these queries @@ -209,7 +209,7 @@ WHERE chat_session_id = $1; -- claim is acquired (fresh insert, or stale-reclaim of an in-flight claim -- older than 60s); returns no rows when terminal (processed) or actively -- in-flight. Every claim mints a fresh claim_token; Mark/Release are --- fenced on it. See the table comment in migration 123 / the lark +-- fenced on it. See the table comment in migration 124 / the lark -- predecessor for the full invariant set. INSERT INTO channel_inbound_message_dedup (installation_id, message_id, claim_token) VALUES ($1, $2, gen_random_uuid())