Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete the ContentType and related db tables in Strapi?

Tags:

strapi

I am using Strapi v3.0.0-beta.18.7

How to delete the ContentType and the related tables from DB ?

I tried the command below, but it is not deleting the db tables.

DELETE  http://localhost:1337/content-type-builder/content-types/application::CONTENT_TYPE_NAME.CONTENT_TYPE_NAME
like image 765
Oksana B Avatar asked Nov 29 '22 21:11

Oksana B


2 Answers

To delete the content-type and related db-tables in Strapi, You can delete the folder inside /api folder having same name as your content-type

enter image description here

Suppose if you want to delete the "product" content type, you can delete the product folder inside of /api

like image 176
Srijan Katuwal Avatar answered May 05 '23 13:05

Srijan Katuwal


The database's tables sync is not managed in the Content Type Builder plugin.

By default, Strapi doesn't delete anything from your database structure.

Strapi is customizable but you will not be able to update this.

Here is an issue that talks about this topic - https://github.com/strapi/strapi/issues/1114

like image 36
Jim LAURIE Avatar answered May 05 '23 12:05

Jim LAURIE