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 multiple schema change #1

Open
29 of 38 tasks
tangenta opened this issue Mar 2, 2022 · 0 comments
Open
29 of 38 tasks

Support multiple schema change #1

tangenta opened this issue Mar 2, 2022 · 0 comments

Comments

@tangenta
Copy link
Owner

tangenta commented Mar 2, 2022

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:

CREATE TABLE t (a INT, c INT);
ALTER TABLE 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.

Teachability, Documentation, Adoption, Migration Strategy:

TBD

Tasks

Code branch: pingcap#32899 (for CI test)

Design:

Framework & refactoring:

Key features:

Not support alter stmts:

Admin & Monitor

Tests

Bugs:

https://github.com/tangenta/tidb/issues?q=is%3Aissue++label%3Abug+

Docs:

Optional:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant