A few days ago i ran into an issue where i was getting the following error running destroy() on a MySql database table.
Unknown column 'model.undefined' in 'order clause'
Investigating further, i came to know that the table in question by chance did not have a primary key.
Looking into the destroy function in the sails-mysql adapter, I figured out the reason to be the callback which is setup to order by the primary key column by default. When it does not have a primary key column, it has undefined and the callback fails.
So i added a primary key and that resolved the issue. I hope it helps someone 🙂
Latest posts by alexey (see all)
- Zend Soap NULL Reponse - August 29, 2018
- Quick Facts About WooCommerce - April 25, 2018
- WordPress stuck on a “Too many redirects” error loop when using SSL - January 17, 2018