# Bake table with custom name

**URL:** <https://discourse.cakephp.org/t/bake-table-with-custom-name/10169>\
**Category:** Need Help\
**Created:** [February 16, 2022, 10:34pm UTC](https://discourse.cakephp.org/t/bake-table-with-custom-name/10169 "2022-02-16T22:34:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerioaf](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rogerioaf](https://discourse.cakephp.org/u/rogerioaf)\
**Post date:** [February 16, 2022, 10:34pm UTC](https://discourse.cakephp.org/t/bake-table-with-custom-name/10169/1 "2022-02-16T22:34:59Z")

</div>

I want to use bake with my tables , but need to give the another name for it

Ex. tb\_user → Users

---

<div class="post-metadata">

**Author:** ![Jawfin](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@Jawfin](https://discourse.cakephp.org/u/Jawfin)\
**Post date:** [February 16, 2022, 11:57pm UTC](https://discourse.cakephp.org/t/bake-table-with-custom-name/10169/2 "2022-02-16T23:57:30Z")

</div>

Unless I’m corrected here, the automated code building `bake` commands expect you to follow the CakePHP naming conventions. If you intend to build a cake app you’d need an exceptional reason not to - for instance you can’t change existing table structure of a decade old legacy app.

But not using the correct formats you will lose a lot of automatic abilities, like models names for a start, but then also validation rules, automatic foreign keys, other features such as automatic timestamp etc. Essentially, much of the stuff which makes us choose CakePHP in the first place.

tldr: Don’t bake; make all the models, tables, entities & templates by hand.

---

<div class="post-metadata">

**Author:** ![drtrppr](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/drtrppr/32/1763_2.png) [@drtrppr](https://discourse.cakephp.org/u/drtrppr)\
**Post date:** [February 17, 2022, 11:52am UTC](https://discourse.cakephp.org/t/bake-table-with-custom-name/10169/3 "2022-02-17T11:52:33Z")

</div>

bake model --help

Option --table : table name to use if you have non-conventional table names.

Will this get you any further?

---

<div class="post-metadata">

**Author:** ![jarekgol](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jarekgol](https://discourse.cakephp.org/u/jarekgol)\
**Post date:** [February 24, 2022, 10:41am UTC](https://discourse.cakephp.org/t/bake-table-with-custom-name/10169/4 "2022-02-24T10:41:09Z")

</div>

Or maybe add alias afterwards.
