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
Hi! We faced a problem that we cannot delete a column.
We use sqlc.embed a lot, and it is essentially is a star expansion over a table's columns, which gets transformed to all columns named individually in the query. The problem is, that if we have a column that we never use in our code, the final query still individually references this column. If we do DROP COLUMN, then a production deploy breaks running code because the column is not available and cause an incident.
The only path I see as a workaround is to:
Create unstaged migration
Run SQLC generate
Commit codegen without the migration in PR A
Commit migration in PR B
Deploy PR A
Deploy PR B
But it also contradicts our CI, which checks that codegen matched the code (need to disable CI checks) and there's also a chance other developer can merge something between A and B, so we have to schedule merge moratorium to do that.
Is there a way to deprecate a column that I am missing? We are using Encore for migrations, and it does not allow to add a "virtual" migrations that would be skipped.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! We faced a problem that we cannot delete a column.
We use sqlc.embed a lot, and it is essentially is a star expansion over a table's columns, which gets transformed to all columns named individually in the query. The problem is, that if we have a column that we never use in our code, the final query still individually references this column. If we do DROP COLUMN, then a production deploy breaks running code because the column is not available and cause an incident.
The only path I see as a workaround is to:
But it also contradicts our CI, which checks that codegen matched the code (need to disable CI checks) and there's also a chance other developer can merge something between A and B, so we have to schedule merge moratorium to do that.
Is there a way to deprecate a column that I am missing? We are using Encore for migrations, and it does not allow to add a "virtual" migrations that would be skipped.
Beta Was this translation helpful? Give feedback.
All reactions