Ticket #1199 (closed defect: invalid)
"symfony doctrine:data-dump" crashes on tables without "id" attribute
| Reported by: | birne | Owned by: | jwage |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | sfDoctrinePlugin | Version: | 0.11.0 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | no | |
| Status: | Pending Core Response | Has Patch: | no |
Description
When dumping data fron an existing database (in my case PostgreSQL) into the fixtures.yml using the "symfony doctrine:data-dump" task, an error occurs when a table has no "id" attribute. The error message is an SQL error handed over from the database:
ERROR: column c.id does not exist LINE 1: SELECT c.id AS c__id, c.name AS c__name, ..
(the actual message can be different, my PostgreSQL throws german messages and I have translated it back myself. Also this error is from my memory as I have fixed all my tables already)
If every tables has to have an id attribute, please check if it is missing before the SQL query gets executed and throw an exception with a smarter message. If the id attributes are optional please have a look why the id attribute has been added to query a table that has none.