# How to create a model

**URL:** <https://forum.mautic.org/t/how-to-create-a-model/8048>\
**Category:** Development\
**Created:** [March 30, 2017, 7:37am UTC](https://forum.mautic.org/t/how-to-create-a-model/8048 "2017-03-30T07:37:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anoop904](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@anoop904](https://forum.mautic.org/u/anoop904)\
**Post date:** [March 30, 2017, 7:37am UTC](https://forum.mautic.org/t/how-to-create-a-model/8048/1 "2017-03-30T07:37:13Z")

</div>

How to create a model and register it with container. Do i only need to create a model and add it in the config file.  
  
Can I directly add tables to db with out using oninstall or onupdate function . will it still work

---

<div class="post-metadata">

**Author:** ![anoop904](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@anoop904](https://forum.mautic.org/u/anoop904)\
**Post date:** [March 30, 2017, 7:37am UTC](https://forum.mautic.org/t/how-to-create-a-model/8048/2 "2017-03-30T07:37:13Z")

</div>

How to create a model and register it with container. Do i only need to create a model and add it in the config file.  
Can I directly add tables to db with out using oninstall or onupdate function . will it still work

---

<div class="post-metadata">

**Author:** ![thecodeine](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@thecodeine](https://forum.mautic.org/u/thecodeine)\
**Post date:** [April 4, 2017, 9:07am UTC](https://forum.mautic.org/t/how-to-create-a-model/8048/3 "2017-04-04T09:07:33Z")

</div>

You should rather use migrations for db schema update 😉
