M
M
mrsbennet2019-08-21 10:13:02
Yii
mrsbennet, 2019-08-21 10:13:02

Exception 'yii\base\InvalidConfigException' with message 'Failed to instantiate component or class "m190621_173618_create_article_table".' what to do?

<?php
use yii\db\Migration;
/**
 * Handles the creation of table `article`.
 */
class m170124_021553_create_article_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('article', [
            'id' => $this->primaryKey(),
            'title'=>$this->string(),
            'description'=>$this->text(),
            'content'=>$this->text(),
            'date'=>$this->date(),
            'image'=>$this->string(),
            'viewed'=>$this->integer(),
            'user_id'=>$this->integer(),
            'status'=>$this->integer(),
            'category_id'=>$this->integer(),
        ]);
    }
    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('article');
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Khomenko, 2019-08-21
@mrsbennet

What to do? Be careful! You have different class name and migration file name: m190621_173618 !== m170124_021553

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question