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
codegen bad exception #1153
Comments
I'm not sure having "." in the column name is going to work at all. You would need to use a "backquote" or ` around the full column name within the queries. The "Table does not exist" error I would imagine is being caused because you are referencing a non-existent table in codegen_settings.xml for foreign key relationships. That would see like the most likely cause to me. The error should include the name of the table attempting to be referenced, just go find the reference and fix it. No primary key is the same type of thing. The error should include the table which does not have a primary key. Almost always you will need a primary key in a table so just go make one in the database and that should fix that problem. |
I found column name was problem but from error i can't see where is problem. Error is "Table does not exist or no primary key " , table exist and have primary key but column name was wrong. I think codegen cannot create model from table and cannot continue. |
Looking at the code, that is not the exact message. It should read: Table does not exist or does not have a defined Primary Key: Followed by the name of the table. If there is nothing there, then something you did is causing it to look for a completely empty table. If you can't see anything obvious in your table names, then the issue is likely with your foreign keys. Somehow, you have a foreign key which is referring to a blank table. What kind of database are you using? If Mysql, are you using an Innodb table, or are you putting your relationships in the codegen_settings.xml? Its hard for us to help you because we have never seen this error. The code is trying to give a reasonable error message, but for some reason, its looking for a blank table. |
Yes "Table does not exist or does not have a defined Primary Key" |
OK, lets make this a v3.2 request to clean this up and check for it in codegen. |
I have a lot of tables with a lot of columns , but debugging codegen errors is sometime a bad process . Why i can't see where is my problem? . Errors like "Table does not exist or there is no primary key" are totally unusable . Maybe some var_dump or column name where codegen stalled will make sense . I know column naming is a big problem but i must remember what i had changed to know where i was wrong. You can test this with just put some dot in column name and codegen will break.
The text was updated successfully, but these errors were encountered: