开发者

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/error开发者_高级运维s/missing_table.ctp

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


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜