S
S
seacjs2019-01-26 12:53:31
MySQL
seacjs, 2019-01-26 12:53:31

How to migrate from a file in Yii2, taking into account the use of vagrant?

I'm using Yii2 basic template out of the box. I run vagrant, run the migrations, everything works and does not give any errors. Regular migrations work fine. But file migrations don't make any changes to the database. I implement it like this:

public $maxSqlOutputLength = 300;
    public function safeUp()
    {
        $this->execute(
            file_get_contents(
                __DIR__ . '/../backup.sql')
        );
    }

5c4c2d5bd9fc3787852571.jpeg
Please let me know what could be the problem or where to look for it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur K., 2019-01-26
@amark

what if you try step-by-step debugging: I suggest inserting one simple UPDATE or INSERT command into the file and try to run the migration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question