# "bake model all" doesn't work with CamelCase tables

**URL:** <https://discourse.cakephp.org/t/bake-model-all-doesnt-work-with-camelcase-tables/1161>\
**Category:** Need Help\
**Created:** [September 14, 2016, 5:27pm UTC](https://discourse.cakephp.org/t/bake-model-all-doesnt-work-with-camelcase-tables/1161 "2016-09-14T17:27:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![celsowm](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@celsowm](https://discourse.cakephp.org/u/celsowm)\
**Post date:** [September 14, 2016, 5:27pm UTC](https://discourse.cakephp.org/t/bake-model-all-doesnt-work-with-camelcase-tables/1161/1 "2016-09-14T17:27:15Z")

</div>

Hi !  
I am trying to create models with this database (SQLServer 2008 R2):

```
Bake All
---------------------------------------------------------
Possible model names based on your database:
- Ajuizamento
- AssuntoLocal
- Comarca
- DividaAvulsa
- Documento
- Execucao
- Executado
- Localidade
- MotivoGRERJ
- Natureza
- Processo
- Recibo
- RespostaTJ
- Serventia
- TipoDocumento
- TipoLogradouro
- sysdiagrams
Run `cake bake all [name]` to generate skeleton files.

```

If I try “bake model all”, for some reason bake try to find a table named “assunto\_local” and not AssuntoLocal.

If I try “cake bake all assuntolocal” works fine, but I would like a way to generate with only one statement because could be necessary recreate everything again in the future.

Thanks.

---

<div class="post-metadata">

**Author:** ![ali](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/ali/32/123_2.png) [@ali](https://discourse.cakephp.org/u/ali)\
**Post date:** [September 15, 2016, 12:50am UTC](https://discourse.cakephp.org/t/bake-model-all-doesnt-work-with-camelcase-tables/1161/2 "2016-09-15T00:50:20Z")

</div>

CakePHP expects your database tables to be in plural, lower case and underscored, like assunto\_local(s), while it expects the classes in your app to be camel case.

So if your db tables are called AssuntoLocal etc. that would be against Cake’s conventions and wouldn’t work as expected.

---

<div class="post-metadata">

**Author:** ![celsowm](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@celsowm](https://discourse.cakephp.org/u/celsowm)\
**Post date:** [September 15, 2016, 1:11pm UTC](https://discourse.cakephp.org/t/bake-model-all-doesnt-work-with-camelcase-tables/1161/3 "2016-09-15T13:11:41Z")

</div>

As far as I know Cake’s conventions are not mandatory.  
And it’s strange because like I’ve said, “bake all assuntolocal” works fine (bake wrote\*\*$this-\>table(‘assuntolocal’);\*\* to define the table) but “bake model all” not.

---

<div class="post-metadata">

**Author:** ![saviobosco](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/saviobosco/32/293_2.png) [@saviobosco](https://discourse.cakephp.org/u/saviobosco)\
**Post date:** [September 15, 2016, 8:48pm UTC](https://discourse.cakephp.org/t/bake-model-all-doesnt-work-with-camelcase-tables/1161/4 "2016-09-15T20:48:17Z")

</div>

In using bake to create model file , the table must be in lower case

---

<div class="post-metadata">

**Author:** ![raul338](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/raul338/32/69_2.png) [@raul338](https://discourse.cakephp.org/u/raul338)\
**Post date:** [September 17, 2016, 1:57am UTC](https://discourse.cakephp.org/t/bake-model-all-doesnt-work-with-camelcase-tables/1161/5 "2016-09-17T01:57:16Z")

</div>

> [@celsowm](#):
>
> As far as I know Cake’s conventions are not mandatory.

But you have to configure in your own way.  
Bake expects the tables and columns to be ok with the cake conventions.
