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
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:
CREATETABLEt (a INT, c INT);
ALTERTABLE t ADD COLUMN b INT,
MODIFY COLUMN c CHAR(5),
ADD INDEX idx(a),
ADD PRIMARY KEY (c),
COMMENT ="comments for t";
Describe alternatives you've considered:
Rewriting the SQL at application level works, but it is not suitable in all the cases.
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:
Describe alternatives you've considered:
Rewriting the SQL at application level works, but it is not suitable in all the cases.
Teachability, Documentation, Adoption, Migration Strategy:
TBD
Tasks
Code branch: pingcap#32899 (for CI test)
Design:
Framework & refactoring:
checkMultiSpecs
func #5onAddColumns
,onDropColumns
,onDropIndexes
#7onDropColumn
#18tidb_enable_change_multi_schema
#109Key features:
add columns
#4add indexes
#38drop columns
#15drop index
#21modify/change column
#39rename index
#47rename column
andchange column
#60alter column
#69alter index visible
andalter index invisible
#77Not support
alter stmts
:add partition
#59truncate partition
#61drop partition
#62Admin & Monitor
admin show ddl jobs
#8admin cancel ddl jobs
MultiSchemaChange
tometrics/ddl.go
#55Tests
Multi-schema-change
Jobs toschrddl
#63Bugs:
https://github.com/tangenta/tidb/issues?q=is%3Aissue++label%3Abug+
Docs:
Optional:
add column a, add index i(a)
add indexes
#101alter table x rename xx
#92The text was updated successfully, but these errors were encountered: