aggtr
aggtr

Reputation: 91

CakePHP 3.6: Removing a table manually (files/dirs)

What is the proper way to remove a table from my code if I have already deleted it from the database manually or via migration? Which files/directories should I delete for a clean delete of the table?

Upvotes: 0

Views: 32

Answers (1)

Greg Schmidt
Greg Schmidt

Reputation: 5099

The files and directories should actually be the easy part: the controller, the model, the entity and the template directory. Unit tests for all those things, if you have them.

But you'll also need to find every reference to that table in associations to other tables, containment in controllers, outputs in other views, etc. Searching all your code for the table name (both singular and plural) will hopefully find most such uses.

But as to a "proper way"? No such advice that anyone can give you, no reliable set of rules you could follow, because every project is so different.

Upvotes: 1

Related Questions