Problems with Bake in Cakephp 3.x "Your database does not have any Tables."

Asked

Viewed 145 times

1

Greetings! I’m trying to generate models, controllers and templates in a Cakephp 3.x project using the Postgresql database. I’ve already created the tables, set up the connection (which is working according to the default Cake homepage), but when I run Bake, I get the following return:

bin/cake bake all

Welcome to CakePHP v3.4.3 Console
---------------------------------------------------------------
App : src
Path: /home/leandro/sites/taskmanager/src/
PHP : 7.0.15-1ubuntu4
---------------------------------------------------------------
Bake All
---------------------------------------------------------------
Possible model names based on your database:
Your database does not have any tables.

The package php7.0-pgsql is already installed and the connection via browser is correct, but Bake is not beyond this point and I can’t generate the files. What to do? Thanks for your attention.

2 answers

0


Your database does not have a different schema than the default one. If so, you need to indicate this in config/app.php:

'schema' => 'schema_name',

0

Another reason for this message is when you do not give proper user privileges in the tables.

If it is so that the user us_tests has full permission in the schema sc_tests use:

GRANT ALL ON SCHEMA sc_testes TO us_testes;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA sc_testes TO us_testes;
GRANT USAGE ON ALL SEQUENCES IN SCHEMA sc_testes TO us_testes;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.