DBZ-2080 Support named PKs in ALTER TABLE

This commit is contained in:
Jiri Pechanec 2020-05-15 07:06:21 +02:00 committed by Gunnar Morling
parent e0f577217d
commit 5940c85103
2 changed files with 5 additions and 1 deletions

View File

@ -598,7 +598,7 @@ alterSpecification
')' #alterByAddColumns
| ADD indexFormat=(INDEX | KEY) uid? indexType?
indexColumnNames indexOption* #alterByAddIndex
| ADD (CONSTRAINT name=uid?)? PRIMARY KEY
| ADD (CONSTRAINT name=uid?)? PRIMARY KEY index=uid?
indexType? indexColumnNames indexOption* #alterByAddPrimaryKey
| ADD (CONSTRAINT name=uid?)? UNIQUE
indexFormat=(INDEX | KEY)? indexName=uid?

View File

@ -11,6 +11,10 @@ alter table t2 drop primary key;
alter table t3 rename to table3column;
alter table childtable add constraint `fk1` foreign key (idParent) references parenttable(id) on delete restrict on update cascade;
alter table table3column default character set = cp1251;
alter table table1 add primary key (id);
alter table table1 add primary key table_pk (id);
alter table table1 add primary key `table_pk` (id);
alter table table1 add primary key `table_pk` (`id`);
#end
#begin
-- Alter database