public function buildSchemaCache()
    {
        $this->cleanupCache();

        $tableSchemas = $this->queryTableSchemas();

        foreach ($tableSchemas as $tableSchema) {
            if ($this->findColumns($tableSchema)) {
                $this->findConstraints($tableSchema);

                $key = $this->getTableCacheKey($tableSchema);
                //Yii::$app->cache->delete($key);
                $result = Yii::$app->cache->set(
                    $key,
                    $tableSchema,
                    $this->schemaCacheDuration,
                    new TagDependency(['tags' => $this->cacheTagName])
                );

                if (YII_ENV == 'dev') {
                    if ($result === true)
                        Yii::info("Table \"$tableSchema->fullName\" has been cached", 'Schema cache');
                    else
                        Yii::error("Caching of \"$tableSchema->fullName\" table failed", 'Schema cache');
                }
            }
        }

        Yii::$app->cache->set(
            $this->getCacheCreationTimeKey(),
            microtime(true),
            $this->schemaCacheDuration,
            new TagDependency(['tags' => $this->cacheTagName]));
    }