-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 changing multiple schema in ALTER TABLE #14766
Comments
Cool! @july2993 @csuzhangxc please pay attention to this change. We should consider the compatibility issues in tidb binlog replication, like replicating binlog from a newer version tidb cluster to old version tidb cluster. |
Related to #5166. |
Looking forward to this one so I can use TiDB with Prisma properly. |
Me too. Although Tidb is 100% mysql compatible, without mutiple schema support, many Orms cannot function properly. |
Close it since most changes have been supported already. |
Feature Request
Is your feature request related to a problem? Please describe:
Currently TiDB only supports one schema change per SQL statement and, in a few cases, multi-schema changes.
Therefore, users often encounter incompatible DDLs when migrating from other databases. The only way is to rewrite a multi-schema DDL into several separated DDLs. For the users that rely on frameworks like "flyway", the rewrite is not even possible.
Describe the feature you'd like:
Support multiple schema changes in a single SQL statement, including ADD , ALTER , DROP and CHANGE for columns and indexes, and changes to table options. For example:
Refer to https://dev.mysql.com/doc/refman/5.7/en/alter-table.html.
Describe alternatives you've considered:
Rewriting the SQL at application level works, but it is not suitable in all the cases.
Tasks
Design:
Refactoring:
Framework:
SubJob
for multi-schema change #35231Key features:
Others:
onDropColumns
andonAddColumns
#35862onDropIndexes
#35960Admin & Monitor
User docs:
Unsolved issues:
add column a, add index i(a)
add indexes
#41602alter table x rename xx
tangenta/tidb#92The text was updated successfully, but these errors were encountered: