You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MySQL: only the first RENAME COLUMN in a multi-column ALTER is applied when parsing goose migrations #4493
When goose migrations rename multiple columns in a single ALTER TABLE using MySQL RENAME COLUMN, sqlc applies only the first rename. Queries that reference subsequently renamed columns fail code generation.
Environment
Engine: MySQL
Migration tool: goose (-- +goose Up / -- +goose Down)
sqlc config: schema: "migrations" (directory of migration files)
Relevant log output
sqlc generate
# queries/users.sql:2:26: column "display_label" does not exist
Database schema
-- ./migrations/001_create_users.sql-- +goose UpCREATETABLEusers (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
label VARCHAR(255) NOT NULL
);
-- +goose DownDROPTABLE users;
-- ./migrations/002_rename_columns.sql-- +goose UpALTERTABLE users
RENAME COLUMN name TO display_name,
RENAME COLUMN label TO display_label;
-- +goose DownALTERTABLE users
RENAME COLUMN display_name TO name,
RENAME COLUMN display_label TO label;
SQL queries
-- name: GetUserByID :oneSELECT id, display_name, display_label
FROM users
WHERE id = ?;
Activity
dimasfeb19 commentedon Jun 30, 2026
Opened #4495 with a fix and a regression test.