Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ALTER TABLE ADD UNIQUE (KEY) is not recognized as an alter option #610

Copy link
Copy link
@niconoe-

Description

@niconoe-
Issue body actions

When trying to parse some SQL like:

ALTER TABLE testtable 
ADD UNIQUE KEY name_of_the_unique_constraint (`UNIQUE_COLUMN`);

or

ALTER TABLE testtable 
ADD UNIQUE name_of_the_unique_constraint (`UNIQUE_COLUMN`);

the parser considers every token after the ADD keyword as "unknown", while adding indexes or constraint works well. This is due to the lack of the presence of the options "UNIQUE" and "UNIQUE KEY" in the AlterOperation::$TABLE_OPTIONS array.

I'll provide a PR about it, fixing also the unit tests about the parser expecting unknown tokens rather than well accepted options.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.