yii2 cache on model code example
Example: yii1 refresh cache schema
Yii::app()->db->schema->getTables();
// clear the cache of all loaded tables
Yii::app()->db->schema->refresh();
Yii::app()->db->schema->getTables();
// clear the cache of all loaded tables
Yii::app()->db->schema->refresh();