I can't refresh the columns metadata into my model?
CREATE TABLE IF NOT EXISTS users' (
'id' INT NOT NULL AUTO_INCREMENT,
'username' VARCHAR(32) NOT NULL,
'password' VARCHAR(128) NOT NULL,
'email' VARCHAR(255) NOT NULL,
'first_name' VARCHAR(128) NULL,
'last_name' VARCHAR(128) NULL,
'users_type_user_type_id' INT NOT NULL,
'stores_store_id' INT NOT NULL,
PRIMARY KEY ('user_id', 'users_type_user_type_id', 'stores_store_id'),
UNIQUE INDEX 'username_UNIQUE' ('username' ASC),
UNIQUE INDEX 'email_UNIQUE' ('email' ASC),
INDEX 'fk_users_users_type1_idx' ('users_type_user_type_id' ASC),
INDEX 'fk_users_stores1_idx' ('stores_store_id' ASC))
ENGINE = InnoDB
Log...
[Tue, 18 Feb 14 16:43:21 -0600][INFO] SELECT 'users'.'username', ..., 'users'.'company', ..., 'users'.'pre_register' FROM 'users' WHERE ... LIMIT 1
The fields 'company' and 'pre_register', not exist into my model now and I tryed with this:
# services.php
$di->set('modelsMetadata', function () {
$adapter = new MetaDataAdapter();
$adapter->reset();
return $adapter;
});
or:
# my_model.php
class MyModel extends Model {
public function initialize(){
$this->useDynamicUpdate(true);
}
}
and the result is:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.company' in 'field list'
#0 [internal function]: PDO->query('SELECT 'users'....')
#1 [internal function]: Phalcon\Db\Adapter\Pdo->query('SELECT 'users'....', NULL, NULL)
#2 [internal function]: Phalcon\Mvc\Model\Query->_executeSelect(Array, NULL, NULL)
#3 [internal function]: Phalcon\Mvc\Model\Query->execute(NULL, NULL)
#4 /var/www/html/mx_com_addicted/verify/app/library/Auth/Auth.php(37): Phalcon\Mvc\Model::findFirst('username = 'sys...')
#5 /var/www/html/mx_com_addicted/verify/app/controllers/AuthController.php(45): Addicted\Auth\Auth->signin(Array)
#6 [internal function]: Addicted\Controllers\AuthController->signinAction()
#7 [internal function]: Phalcon\Dispatcher->dispatch()
#8 /var/www/html/mx_com_addicted/verify/public/index.php(18): Phalcon\Mvc\Application->handle()
#9 {main}
Can you help me? Regards,
A!~