-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
added index flags to schema table #308
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-500 We use Jira to track the state of pull requests and the versions they got |
@bamarni: does this make sense. for example PostgreSQL allows us to define a function call or constrains when creating an index, if we want to support this we will have to add yet another parameter to those functions.. Wouldn't it be better to add support for raw index definition right now? (Just like it's with the columns definition, where you have to specify the rest of the declaration) |
@mvrhov : I understand your concern, personally my goal is to define a fulltext index on an entity mapping, I was planning to then submit a PR to the ORM in order to leverage those "flags" in the different drivers (see https://gist.github.com/bamarni/5362442 for an example). Then wether it should be abstracted or through database-specific raw definition is not for me to judge, as a side note, this is currently already implemented in the MysqlPlatform (https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L598), but not leveraged at the Schema Table level. @beberlei what do you think? |
PostgreSQL allows me to do something like that:
IMO, the "raw" index definition where you specify everything right of |
I don't really know the internals but I guess then doctrine wouldn't be able to do schema diff for those raw indexes? It'd be something you'll have to keep in mind and handle manually on involved machines in multiple situations (structure changes during development, production database upgrades) while currently I'm only relying on doctrine self-upgrading tools (doctrine:schema:update and doctrine migrations). So imo it is much more robust to have flags, usually it'd pretty simple to handle, in my use case here it's only 1 keyword to add. |
@mvrhov as the Index class already has a concept of flags, it makes sense to expose them in the Schema too IMO |
added index flags to schema table
We can always refactor towards "indexDefintion" later |
This would allow, for example, to create some fulltext indexes with the MysqlPlatform, by passing the "fulltext" flag.