Devin Dixon
Devin Dixon

Reputation: 12383

Removing a Table From CakePHP

I am trying to remove a table from CakePHP. All the tables were created with the cake bake function and I have removed the table from all the models. But when I remove the table from the database I get an error message:

Error: Database table channels_offers for model ChannelsOffer was not found.

Notice: If you want to customize this error message, create app/views/errors/missing_table.ctp

So how do I remove a table that was originally baked in?

Upvotes: 0

Views: 394

Answers (1)

Charles Sprayberry
Charles Sprayberry

Reputation: 7853

Well, it appears that you still have a model called ChannelsOffer. You would need to add a property to your ChannelsOffer model. Here's an example

class ChannelsOffer extends AppModel {

    // this tells the model not to use a table, alternatively you could supply your 
    // own table name here.
    public $useTable = false;

Upvotes: 3

Related Questions