Nette\InvalidArgumentException Table xxx.y' does not exist
Notice: This thread is very old.
- esorimer
- Member | 114
I have updated nette 2.2 to 2.3.
Now, this code throws an exception:
return $this->database->table("xxx.yyyy");
I think it is similar problem to this issue: https://github.com/…base/pull/93
But this time its not problem of view, but of a table (yyyy) from a different database (xxx).
- esorimer
- Member | 114
CZechBoY wrote:
Try define own IStructure which prepends database name before table name.
How can I use my own Structure? Is there any config option …?
- CZechBoY
- Member | 3608
In your config.local.neon
database:
dsn: '...'
user: '...'
password: '...'
structure: App\MySuperStructure
App\MySuperStructure.php
namespace App;
use Nette\Database\IStructure;
class MySuperStructure implements IStructure
{
// implement interface
}
Last edited by CZechBoY (2016-05-23 15:22)
- esorimer
- Member | 114
Hi,
thanks. I had to change in DatabaseExtension class:
- change ->setClass(‘Nette\Database\Structure’)
to
->setClass($config['structure'])
- add
'structure' => 'Nette\\Database\\Structure'
to $databaseDefaults array.
Now it works