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_key() in DB Forge is not behaving correctly #1946
Comments
Looking at the mysql-driver it does expect key to be either string or an array, EDIT: i'm guessing it should have a test included for the primary key, if ($primary && is_array($key))
{
// ...
} |
I'll write up a test with your suggestion. But you're right that should fix it. |
I made a small forge for the sessions table to test things out. @narfbg this shows an sql error, the table is created not the less, https://gist.github.com/4053937 EDIT EDIT2 |
It seems the problem is in the _process_indexes where it returns |
No, that was by design. A property was missing: b0a97c1 On choosing key names - I don't think this was ever possible, the docs don't say anything about it. |
It was never possible. edit: if there's a rationale to support named keys, duplicate keys is definitely the main one |
OK, i overlooked that dbforge does add a key name to a key, you can just not name it yourself. |
Am i correct to assume that you can't use The only way (i see) to add keys to an existing table is to use Issue: edit: is there a way to drop keys as well? e.g. |
Yes, you are correct. I don't think that there's a way to drop keys. This as well as adding keys should be considered feature requests. Edit: A feature request for adding keys without a |
add_key not setting multiple-column keys when given array Signed-off-by: GDmac <grdalenoort@gmail.com>
Fix bcit-ci#1946 dbforge add_key
The documentation shows that:
But the below code in add_key() function is preventing this behavior. Because we are never allowed to add an array as a key value the _create_table function will never be picking up an array to add as a key.
The text was updated successfully, but these errors were encountered: