Skip to content

[Feature Request]: ALTER TABLE phase II #10380

Closed

Description

@domingozhang

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

ALTER TABLE tbl_name
    [alter_option [, alter_option] ...]

alter_option: {
    table_options
  | ADD [COLUMN] col_name column_definition
        [FIRST | AFTER col_name]
  | ADD [COLUMN] (col_name column_definition,...)
  | ADD {[INDEX | KEY] [index_name]
        [index_option] ...
  | ADD [CONSTRAINT] UNIQUE [INDEX | KEY]
        [index_name][index_option] ...
  | ADD [CONSTRAINT] FOREIGN KEY
        [index_name] (col_name,...)
        reference_definition
  | ADD [CONSTRAINT [symbol]] PRIMARY KEY
        [index_type] (key_part,...)
  | Moidfy [COLUMN] old_col_name column_definition
        [FIRST | AFTER col_name]
  | ALTER INDEX index_name {VISIBLE | INVISIBLE}
  | DROP [COLUMN] col_name
  | DROP {INDEX | KEY} index_name
  | DROP FOREIGN KEY fk_symbol
  | DROP PRIMARY KEY
  | RENAME [TO | AS] new_tbl_name
  | CHANGE [COLUMN] old_col_name new_col_name column_definition
        [FIRST | AFTER col_name]
}

key_part: {col_name [(length)] | (expr)} [ASC | DESC]
index_option: {
  COMMENT[=]'string'
}
table_options:
    table_option [[,] table_option] ...
table_option: {
  COMMENT [=] 'string'
}

Describe the feature you'd like

  1. Support add/drop primary key
  2. Support modify columns

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

No response

Additional information

No response

Activity

  1. added
    source/on-demand
    on Jul 3, 2023
  2. added this to the 1.0.0 milestone on Jul 3, 2023
  3. added
    attention/doc-influence
    on Jul 5, 2023
  4. dengn commented on Jul 6, 2023

    @dengn
    Contributor
  5. daviszhen commented on Jul 22, 2023

    @daviszhen
    Contributor

    Image

  6. domingozhang commented on Aug 1, 2023

    @domingozhang
    ContributorAuthor

    alter table with partitions and multi layers foreign key are not supported

  7. lacrimosaprinz commented on Aug 2, 2023

    @lacrimosaprinz
    Contributor
  8. Ariznawlll commented on Aug 19, 2023

    @Ariznawlll
    Collaborator

    alter table modify column
    alter table change column
    alter table rename column
    alter table add/drop primary key
    test done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

attention/doc-influencekind/featurepriority/p-1source/on-demand

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions