Database error - Unknown column 'id' in 'field list'


If you are installing CodeExtinguisher on an exsiting database you my run into an error that is similar to this:

 

A Database Error Occurred

Error Number: 1054

Unknown column 'id' in 'field list'

SELECT `ad_id`, `id` FROM (`ads`) ORDER BY `id` desc

 

CodeExtinguisher assumes that all tables have a primary key with a column name of id.

 

You may have tables that have a primary key in which the column name is not id. In the example error above the primary key happened to be ad_id.

 

To fix this error you can add primary_id: {primary_key_column_name} to the yaml file corresponding to the table.