We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Column 'storage' is not part of column map

Hey guys,

like the topic said, I've got a problem with a Model.

I developed my Site on my localhost with MAMP and everything just works as expected. Now I uploaded all files to my webhost and ex-/imported my database. And now on my webserver I get this error:

Column 'storage' is not part of the column map

And I don't know why, because I didn't change anything on my code or database. If I take a look into the Modelfile where this error comes from, everything is ok:

/**
 * Independent Column Mapping.
 */
public function columnMap()
{
    return array(
    'id' => 'id', 
    'name' => 'name', 
    'description' => 'description', 
    'att' => 'att', 
    'hp' => 'hp', 
    'shield' => 'shield', 
    'speed' => 'speed', 
    'storage' => 'storage',
    'sprit' => 'sprit', 
    'metal' => 'metal', 
    'silicium' => 'silicium'
    );
}

I already restarted my apache and nginx, but the problem is still there.

Hope someone can help me to fix this.

Fuhunter



98.9k

What models meta-data adapter are you using?

Also, you can freely remove that column map from your model if you aren't renaming any column.



17.1k
Accepted
answer
edited Sep '14

I'm using

    use Phalcon\Mvc\Model\Metadata\Memory as MetaDataAdapter;

    /**
     * If the configuration specify the use of metadata adapter use it or use memory otherwise
     */
    $di->set('modelsMetadata', function () {
    return new MetaDataAdapter();
    });

I commented column map out. Still the same error..

EDIT:

Found out that this request produces the error, but I don't know why.

        $ships = Ships::find(array(
            'id > 10'
            /*'cache' => array(
                'key' => 'attships',
                'lifetime' => 86400
                )*/
            ))->toArray();


47.7k
edited Jun '15

Isn't this a bug? I experienced the same thing today.

It is maybe a caching problem. Strange behaviour. Sometimes it fixes it self. Sometimes you try it few hours later and everything works, or you generate the model again



47.7k

I'm glad I found this post. I needed a sanity check.