Search for Resources and Solutions

How the apps tables are created automatically

Until Midrub version 0.0.8.1 Final, each Midrub's apps have created their tables only when them were used. For example, when you have created the Quick Replies in the Midrub Chatbot app, the required table was created automatically. This was a good idea at the begin but someone haven't started to use immediately these apps and when a user was deleted, the hooks weren't able to delete the user's records from the apps tables because them weren't created.

From the Midrub version 0.0.8.1 Final, Midrub will create the apps tables even at the installation. If you want to create an app, you have to create the folder models in your app with models which creates the missing tables in the database.

It's important to remember, each model should have an original name. Moreover, each file's name should have the model's name. From Midrub 0.0.7.0 i have always created apps with this structure and now each Midrub app should have same models folder if the apps have new tables.

In the video below you will see how the tables are created automatically:


Was this article helpful?