antlr_supported_sql.mysql.ddl.alter.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <sql-cases db-types="MySQL" namespace="mysql.ddl.alter"> <sql-case id="alter_table" value="ALTER TABLE t_order FORCE" /> <sql-case id="alter_table_with_space" value=" ALTER TABLE t_order FORCE " /> <sql-case id="alter_table_with_back_quota" value="ALTER TABLE `t_order` FORCE" /> <sql-case id="alter_table_add_column" value="ALTER TABLE t_order ADD column4 VARCHAR(10)" /> <sql-case id="alter_table_add_columns" value="ALTER TABLE t_order ADD column4 VARCHAR(10), ADD column5 VARCHAR(10), ADD column6 VARCHAR(10)" /> <sql-case id="alter_table_add_column_with_first" value="ALTER TABLE t_order ADD column3 VARCHAR(10) FIRST" /> <sql-case id="alter_table_add_column_with_after" value="ALTER TABLE t_order ADD column4 VARCHAR(10) AFTER order_id" /> <sql-case id="alter_table_add_column_with_first_after" value="ALTER TABLE t_order ADD column5 VARCHAR(10) FIRST, ADD column6 VARCHAR(10) FIRST, ADD column7 VARCHAR(10) AFTER column5, ADD column8 VARCHAR(10) AFTER column6" /> <sql-case id="alter_table_modify_column" value="ALTER TABLE t_order MODIFY column4 VARCHAR(20)" /> <sql-case id="alter_table_modify_columns" value="ALTER TABLE t_order MODIFY column4 VARCHAR(20), MODIFY column5 VARCHAR(20), MODIFY column6 VARCHAR(20)" /> <sql-case id="alter_table_modify_column_with_first" value="ALTER TABLE t_order MODIFY status VARCHAR(20) FIRST" /> <sql-case id="alter_table_modify_column_with_after" value="ALTER TABLE t_order MODIFY status VARCHAR(20) AFTER order_id" /> <sql-case id="alter_table_modify_column_with_first_after" value="ALTER TABLE t_order MODIFY status VARCHAR(20) FIRST, MODIFY user_id INT AFTER status" /> <sql-case id="alter_table_drop_column" value="ALTER TABLE t_order DROP user_id" /> <sql-case id="alter_table_drop_columns" value="ALTER TABLE t_order DROP user_id, DROP column5" /> <sql-case id="alter_table_change_column" value="ALTER TABLE t_order CHANGE user_id column4 VARCHAR(10)" /> <sql-case id="alter_table_add_primary_key" value="ALTER TABLE t_order ADD CONSTRAINT pk_user_id PRIMARY KEY (user_id)" /> <sql-case id="alter_table_add_composite_primary_key" value="ALTER TABLE t_order ADD status int,ADD CONSTRAINT pk_order_id_user_id_status PRIMARY KEY (order_id, user_id, status)" /> <sql-case id="alter_table_add_unique_key" value="ALTER TABLE t_order ADD CONSTRAINT uk_order_id UNIQUE (order_id)" /> <sql-case id="alter_table_add_foreign_key" value="ALTER TABLE t_order_item ADD CONSTRAINT fk_order_id FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE" /> <sql-case id="alter_table_add_constraints" value="ALTER TABLE t_order_item ADD PRIMARY KEY (order_id),ADD UNIQUE (order_id), ADD FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE" /> <sql-case id="alter_table_drop_primary_key" value="ALTER TABLE t_order DROP PRIMARY KEY" /> <sql-case id="alter_table_drop_foreign_key" value="ALTER TABLE t_order DROP FOREIGN KEY fk_order_id" /> <sql-case id="alter_table_drop_constraints" value="ALTER TABLE t_order DROP PRIMARY KEY, DROP FOREIGN KEY fk_order_id" /> <sql-case id="alter_table_add_index" value="ALTER TABLE t_order ADD INDEX idx_order_id (order_id)" /> <sql-case id="alter_table_add_fulltext_index" value="ALTER TABLE t_order ADD FULLTEXT INDEX idx_column1 (column1)" /> <sql-case id="alter_table_add_composite_index" value="ALTER TABLE t_order ADD INDEX idx_order_id_user_id_status (order_id, user_id, status)" /> <sql-case id="alter_table_add_indexes" value="ALTER TABLE t_order ADD INDEX idx_column1 (column1), ADD INDEX idx_column2 (column2), ADD INDEX idx_column3 (column3)" /> <sql-case id="alter_table_drop_index" value="ALTER TABLE t_order DROP INDEX idx_order_id" /> <sql-case id="alter_table_drop_indexes" value="ALTER TABLE t_order DROP INDEX idx_column1, DROP INDEX idx_column2, DROP INDEX idx_column3" /> <sql-case id="alter_table_rename_index" value="ALTER TABLE t_order RENAME INDEX idx_column1_bak TO idx_column1" /> </sql-cases>