S
S
Svetlana Galenko2018-12-07 19:04:32
Yii
Svetlana Galenko, 2018-12-07 19:04:32

CDbException Table '{{config}}' referenced in active record of class 'Config' not found in database?

Hello, on the site for the wrong reason, such an error got out, please help to cope with it:

CDbException
Таблица "{{config}}", упомянутая в записи active record класса "Config", не найдена в базе данных.

/var/www/user/data/www/site.ru/framework/db/ar/CActiveRecord.php(2385)

/**
2375      * Constructor.
2376      * @param CActiveRecord $model the model instance
2377      * @throws CDbException if specified table for active record class cannot be found in the database
2378      */
2379     public function __construct($model)
2380     {
2381         $this->_modelClassName=get_class($model);
2382 
2383         $tableName=$model->tableName();
2384         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2385             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2386                 array('{class}'=>$this->_modelClassName,'{table}'=>$tableName)));
2387                 
2388         if(($modelPk=$model->primaryKey())!==null || $table->primaryKey===null)
2389         {
2390             $table->primaryKey=$modelPk;
2391             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2392                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2393             elseif(is_array($table->primaryKey))
2394             {
2395                 foreach($table->primaryKey as $name)
2396                 {
2397                     if(isset($table->columns[$name]))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim, 2018-12-10
@swallow_97

Check if the table exists in the database. If using schema caching, clear the cache or disable schema and query caching. Then everything should work) The server has nothing to do with it, I think.

M
morricone85, 2018-12-07
@morricone85

there is no such table in the database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question