Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support altering columns in SQLite migrations by RENAME-ADD-UPDATE-DROP #333

Open
Rongronggg9 opened this issue Apr 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Rongronggg9
Copy link

Since 7bcf9b2, dropping columns in SQLite migrations is possible. We may further support altering columns in SQLite by:

ALTER TABLE "foo" RENAME COLUMN "bar" TO "bar_random_string";
ALTER TABLE "foo" ADD "bar" NEW_TYPE NOT NULL  DEFAULT "baz" /* comment */;
-- Do not CAST(x as JSON): https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/2011
UPDATE "foo" SET "bar" = CAST("bar_random_string" as NEW_TYPE);
ALTER TABLE "foo" DROP COLUMN "bar_random_string";
@UpstreamData
Copy link

+1. Would love to see this, mainly for migrating fields to allow null.

@waketzheng waketzheng added the enhancement New feature or request label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants