New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for creating, altering, and dropping indices #167
Conversation
…ices Parsing create index now supports all these changes
This in particular: Edit: Removed that change entirely because we needed to rename that command from |
…is_fulltext/is_spatial
Same functionality has now been moved to ALTER TABLE ... ADD INDEX ...
Support for One open issue there is that the index_name is not being captured in the case of That's because by default, even when parsing indices in CREATE TABLE, the index name is not captured and the I'm not sure if changing one of those will also break backward compatibility with the other modules such as pg_engine or mysql_engine. |
@the4thdoctor we had discussed the ordering for subcommands in alter table statements, that additions of columns should come before additions of indices, and removing indices should come before removing columns. But that would have some edge cases, e.g.
If we change the order here and add column2 first, that will throw an error because it already exists. Can we use the same order in which the commands appeared in the MySQL query? That should already be accurate, I think. |
If you can manage easily this particular case please go for it. Thanks. |
This is already taken care of. We use the same order as the MySQL commands we receive. |
Thanks and sorry for bein MIA for a while. |
Apologies for the long delay, I've checked the PR and the previous tests are running fine. |
Right now, creating indices is only being done automatically from the
CREATE TABLE
statements. This pull request aims to change that and allow adding indices to existing tables.Parser changes:
is_functional
flag in key_dicis_partial
flag in key_dicis_fulltext
oris_partial
flag in key_dicindex_type
in key_dic as either BTREE or HASH.CREATE INDEX
ALTER TABLE ADD INDEX
ALTER TABLE RENAME INDEX
ALTER TABLE DROP INDEX
DROP INDEX
Open questions
index_type
be? I'm setting it toNone
for now.