2015-09-12 17:55:15 5471次浏览 1条回答 0 悬赏 10 金钱

配置db组件的时候设置了enableSchemaCache为true开启了缓存,我现在修改了某个表的结构,要如何更新这个表的缓存呢。现在我是用Cache组件的flush方法吧所有的缓存都删除一下。但这样觉得不太好,有没有只删除某个表的缓存或者只删除数据表结构缓存的。

最佳答案

  • 500miles 发布于 2015-09-15 13:08 举报

    Yii::$app->db->schema->refresh(); flush all the schema cache

    Yii::$app->db->schema->refreshTableSchema($tableName); clear the particular table schema cache

    1 条回复
    回复于 2015-09-15 13:10 回复

    上面是 针对 表结构缓存

    , 觉得很赞
    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
addchild
见习主管

addchild

注册时间:2014-10-14
最后登录:2016-07-27
在线时长:9小时35分
  • 粉丝4
  • 金钱85
  • 威望20
  • 积分375

热门问题