do i have to clear schema cache after table structure changes?

I enable db schema caching as instructed at [ http://www.yiiframework.com/doc-2.0/guide-tutorial-performance-tuning.html#enable-schema-caching] . It does not say how to clear cache after db changes.

I would like to confirm that db schema works clear cache automatically ??

make sure you set:

‘schemaCacheDuration’ => 3600,

to whatever duration works for you. the cached schema will expire after that time.

You can clear out the cache manually when you launch new schema changes, with command line:

./yii cache/flush-schema

Looking at: https://github.com/yiisoft/yii2/pull/8652 it would seem in most cases you would not have to clear it yourself anymore.

cool yes, it seems that if you’re using migrations to update your table structure the migration will clear the cache. If you’re not using migrations you’ll need to clear the cache yourself.