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
Regression in 2.0.11 - haveInDatabase() no longer works with tables that don't have a primary key #1761
Comments
Also, inserting data into a table with a database prefix doesn't work either. For example: $I->haveInDatabase('testdb.exampletable', array(...)); $this->driver->getPrimaryColumn($table) will fail with: |
We have the same issue with a table that doesn't have a primary key. |
I have this issue with a regular table (without prefix, with pk). It seems that:
called from Relates to #1846 |
fixed with #1846 |
@DavertMik does this fix the issue with MySQL database tables that simply do not have a primary key? That was the initial report here. I don't see anything in the commit that resolves that issue. |
I am using a MySql table without a primary key and am seeing the same error mentioned above. |
Same for me - still is not working for table with primary key for 2 fields. |
Just so we are clear since it looks like lots of different issues getting mixed together, the basic problem for us remains that we have tables w/o primary keys we need to insert data into, that is no longer possible due to the reported regression. |
Why would you have a table without a primary key? I will implement support for multi-column primary keys, PostgreSQL way: https://wiki.postgresql.org/wiki/Retrieve_primary_key_columns |
@Naktibalda I work with legacy software, we are working to improve the schema, but part of that is ensuring good test coverage first ;) |
I solved all primary key issues. |
After upgrading from 2.0.10.1 we noticed a number of failing tests because haveInDatabase is now throwing an exception when trying to insert data into a table without a primary key. It is now throwing the error:
Exception: Table exampletable is not valid or doesn't have no primary key
This error appears to be introduced in PR: #1727.
The text was updated successfully, but these errors were encountered: