Table names altered by bake

I’m installing Cake for the 1st time. I’ve got databases and tables, and tried to run
bin/cake bake all --everything
to create a bunch of files. When it encounters a table named ‘BidBuy_totals’, it produces an error:
2018-08-21 02:25:17 Error: [Cake\Database\Exception] SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘master.bid_buy_totals’ doesn’t exist in /Users/lundo/Sites/tarisio_cmt/api/vendor/cakephp/cakephp/src/Database/Schema/Collection.php on line 131
It not only sets it tolowercase, but adds ‘_’ before ‘Buy’! Similarly, my ‘AR_unknown_house’ table produces an error trying to locate ‘a_r_unknown_house’.
Is there an internal setting that tells Cake to use table names as they appear?

cake uses its magic by assuming that you follow some pointers in first steps of creating application, those table names are something that cake doesnt expect,

https://book.cakephp.org/3.0/en/intro/conventions.html#database-conventions

CakePHP is a conventions over configuration framework. If you don’t follow the CakePHP conventions, then a lot of the automated tools (Bake being a good example) will not work as expected (Or at all).

So, either follow the conventions, or don’t use Bake (and create everything manually)

“Follow conventions or don’t use Bake”! That’s a rather inflexible “solution”. I’ve got multiple existing databases and tables, and would like to start using Cake. Bake apparently does a “SHOW TABLES” command to get a list of tables, then modifies those names to fit its conventions, then produces a fatal error when it fails to find the tables with modified names??? It’s hard to believe such foolish code would be included in such a smart package. Can anyone confirm that there’s no way to tell bake to use the existing table names?

Bake apparently does a “SHOW TABLES” command to get a list of tables, then modifies those names to fit its conventions.

By default that is more or less exactly what it does, purely because Bake is built to follow the CakePHP conventions. To be more detailed, it gets a list of all DB tables, converts them into model names (based on the convention) and works from there.

Bake does allow you to bake the model layer (unfortunately only one model at a time) with custom table names by using the --table option to overwrite the default.

You can read up on the Cake conventions in the book