Nette 2.3.1 Database bug? LogicException Table ‘client’ does not have a primary key

Notice: This thread is very old.
silviustan
Member | 22
+
+1
-

Hi,

I get this strange error but the table that I try to make a selection has a primary key named id.

The code that I run:

$this->database->table('client')->get(1);

Anybody else that have same problem? Is this a bug or something?

greeny
Member | 405
+
+1
-

Try these steps:

  • clear cache
  • check if given table has primary key
  • check if you are connecting to correct database / host
  • restart apache (or whatever is running your server)

IMHO before you ask anything, try with clearing cache, its sometimes buggy, mainly in database :)

silviustan
Member | 22
+
0
-

Cleared cache and is working. Thanks a lot! Sorry for stupid question :)