Removing the "tab" prefix from the table name

Hi Folks,

Can I make the name of a doctype database table without the “tab” prefix ?

if I create a doctype with the name “myDoctype” a table in the db is created with the name “tabmyDoctype
can I make the db table name “myDoctype” also ?

Thanks

Hey @Mohamed_Eid

I believe there is no way to create a doctype named myDoctype, but you can rename it using this command. Please try this:

bench --site [site-name] mariadb
RENAME TABLE `tabmyDoctype` TO `myDoctype`;
exit
1 Like

Please don’t rename the table.
tab piece is hardcoded, ref: frappe/frappe/database/schema.py at 847012e415ba4414371b5ced07eafcd5a20d7209 · frappe/frappe · GitHub

If you can tell the specific use case, we might be able to better help you.

2 Likes

Hey Manav,
Thanks for the information. I really appreciate it.
These commands will change the table name in the database right. But It will make a misconfiguration with frappe and Desk.
Thank You indeed.

Thank You, rtdany10
You really helped me!
I appreciate it very much.

1 Like