However, this delete will not get cascaded, therefore if RestaurantPhotoLabel was a foreign key for some other table, those RestaurantPhotoLabel objects would not get deleted without the other table getting deleted first. More on deleting your own objects to come! 🛠️
So if you didn’t want some of the test data we created earlier to exist in your database schema, running something like this would delete them!
All that will remain is the table itself; all of its rows will be deleted. The auto-incremented ids will not reset. This will once again only work if the table to be deleted is not referenced in any other tables. If the table you’d like to delete does have nested relationships to other tables, keep reading ⬇️
Deleting nested tables
Deleting nested tables requires cascading deletes. This means tables must be deleted in the right order in order to cascade and get deleted properly. We provide a version of this for you in the **"**Data" page!