I’m using a MariaDB database (with InnodDB engine) and for some reason Yii complains about some tables not having a primary key. The tables have a primary key defined in database (with an unsigned INT auto increment value), but Yii throws the following database exception:
app\\models\\Answer does not have a primary key. You should either define a primary key for the corresponding table or override the primaryKey() method.
If I add the primaryKey() method manually to my model it will work then, but it causes errors at some other places, for example in this case.
Why doesn’t Yii recognize my primary keys automatically? I’m using the latest version of Yii2.