antlr_supported_sql.postgre.ddl.alter.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <sql-cases db-types="PostgreSQL" namespace="postgre.ddl.alter"> <sql-case id="alter_table" value="ALTER TABLE t_order FORCE ROW LEVEL SECURITY" /> <sql-case id="alter_table_with_space" value=" ALTER TABLE t_order FORCE ROW LEVEL SECURITY " /> <sql-case id="alter_table_with_back_quota" value="ALTER TABLE `t_order` FORCE ROW LEVEL SECURITY" /> <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_alter_column" value="ALTER TABLE t_order ALTER column4 TYPE VARCHAR(20)" /> <sql-case id="alter_table_alter_columns" value="ALTER TABLE t_order ALTER column4 TYPE VARCHAR(20), ALTER column5 TYPE VARCHAR(20), ALTER column6 TYPE VARCHAR(20)" /> <sql-case id="alter_table_drop_column" value="ALTER TABLE t_order DROP column4" /> <sql-case id="alter_table_drop_columns" value="ALTER TABLE t_order DROP user_id, DROP column5" /> <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_check" value="ALTER TABLE t_order ADD CONSTRAINT chk_order_id CHECK (order_id > 0)" /> <sql-case id="alter_table_add_constraints" value="ALTER TABLE t_order_item ADD PRIMARY KEY (order_id), ADD UNIQUE (order_id), ADD CHECK (order_id > 0), ADD FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE" /> <sql-case id="alter_table_drop_constraint" value="ALTER TABLE t_order DROP CONSTRAINT pk_order_id" /> <sql-case id="alter_table_drop_constraints" value="ALTER TABLE t_order DROP CONSTRAINT pk_order_id, DROP CONSTRAINT uk_order_id, DROP CONSTRAINT idx_order_id" /> <sql-case id="alter_table_rename_constraints" value="ALTER TABLE t_order RENAME CONSTRAINT idx_order_id_bak TO idx_order_id" /> <!-- <sql-case id="create_table_with_exist_index" value="ALTER TABLE t_order ADD PRIMARY KEY USING INDEX idx_order_id" /> --> </sql-cases>