I installed new app and customize it, but its tables are exist in site.local site database

I installed new app with a name meeting by following the YouTube tutorial this one: Session 1: Creating an App - YouTube

I created parent and child doctypes but when I go into the database to see tables that are created in result of these doctypes I didn’t find any table there. I confirmed the name of the database from here:
frappe-bench/[my-custom-site-name]/site-config.json

Then I search for tables in the default site database that is site1.local, the tables are existing there. Kindly help me in this regard. Tell me what will be the mistake I done. Also please suggest me the probable solution.

  1. In terminal, project-name/frappe-bench$ bench mysql

  2. show tables;

  3. Here you find your tables followed by tab keyword

When I typed bench mysql it show that:

mysql command is depricated
Did you mean “bench mariadb”?

Then I typed this command and find out my tables. But my question was not this.

Actually my question is I saw tables in site.local database not in meeting.dev site database that I created. What is this???

go to your sites folder check what is your currentsite. it is mentioned in currentsite.txt

I checked, it is site1,local
Surprising!

I installed app on my new site meeting.dev via this command
bench --site meeting.dev install-app meeting

What is happening here?

before starting out you should set the default site.

bench use meeting.dev

then onwards all the changes would be in that database. That’s it

No issues however. The doctypes you created have been made in your custom app too.

Just use the above command to switch sites and do bench migrate and start again. But you’ll have to re-enter data.

Also, if you are trying to customize in case, don’t forget to take fixtures. Will save a lot of effort.

When I experienced a similar problem, it was because I was opening the wrong mysql database.

Check your current database name as you query and verify that its the right one from the sites site_config.json file.

I checked it, It is not write one. That’s why I post a problem here. Thanks for your reply.

I used this command

bench use meeting.dev

then this one:

bench migrate

After this I again checked tables, they are still in the same database means in database of site1.local

Did you use bench mysql or bench --site meeting.dev mariadb

They should be available after the site switch and migrate. You have already installed the app on meeting.dev so theres no doubt the doctypes were not installed there

Let me explain:
The database of site1.local is _1bd3e0294de19198 and database of meeting.dev that is my own created site is _bcad64afbf268a6a

After using above two commands bench use meeting.dev and bench migrate I typed:

mysql -u root -p

after entering password I had the access of database. Then I type:

SHOW DATABASES;

All databases was in front of me. Then I typed:

use _bcad64afbf268a6a;

After this I typed:

show tables;

I didn’t find tabmeeting table here. For confirmation I switched to the site1.local database. Here I found this table.

Now what is this. Kindly help.

If you are able to access Meeting DocType in the App UI i.e. DocType list. Open it and save it once more

Listen!

I changed the password when I was working on meeting.dev site. Now when I applied that password it was not applied.

Then I typed the password that I set during site and app creation time. It opened setup popup appeared. I select the country and then desk page appeared. I searched my created doctypes then now they are not there.

Now whats Next!

Do one thing. Open your app directory. Can you see your doctypes in that app in the correct module ?

If yes, then do bench migrate

No, doctype directory is not there.

It was not there before, that’s why I started back tracing and found the issue that posted here. I searched for it when I just have to start writing script after creating doctypes. One thing more I already used the command to be in development mode.

This is strange.

Try making a test doctype and see if you can find it in your app. I’m assuming it is called meeting.

Then it should like this:

meeting —> meeting —> meeting —> doctype ----> test_doctype_folder