fb_pixel

Why the transaction did not work when the migration to yii2 was rolled back?

Development | Databases
Description
There is a migration written through safeUp()/safeDown().
Made a migration, decided to roll back

public function safeDown()
    {
        $this->dropTable('{{% post_tags}}');
        $this->dropTable('{{% tags}}');
        $this->dropTable('{{%%}}});
        $this->dropTable('{{% post}}');
    }

It was an error due to FK(my joint), as a result, there were 2 tables left in the database(category and post).
And if I'm not mistaken(maybe it was before, but it seems to be not) in the migration table an entry m000000_000000_base appeared with the date 1456394833(February 25)

What have I done wrong? Or what is the problem with the transaction?
Attachments
No attachments
Info
Description
If the database is MySQL, then there, if memory serves me, transactions do not work for creating/deleting tables.Faced a similar problem when creating tables, for example:
Create table A, add foreign key A to B.All of this is wrapped in safeUp.If the description of the creation of key B is an error, then table A will create a migration, and a key will be thrown out to create the key.Having edited this migration when trying to use it, it will again take off that table A already exists.

on January 13th, 2020 (10:10 pm)
All coments
This job has not been commented yet.


Why the transaction did not work when the migration to yii2 was rolled back?

Development | Web Development
Description
There is a migration written through safeUp()/safeDown().
Made a migration, decided to roll back

public function safeDown()
    {
        $this->dropTable('{{% post_tags}}');
        $this->dropTable('{{% tags}}');
        $this->dropTable('{{%%}}});
        $this->dropTable('{{% post}}');
    }

It was an error due to FK(my joint), as a result, there were 2 tables left in the database(category and post).
And if I'm not mistaken(maybe it was before, but it seems to be not) in the migration table an entry m000000_000000_base appeared with the date 1456394833(February 25)

What have I done wrong? Or what is the problem with the transaction?
Attachments
No attachments
Info
Description
If the database is MySQL, then there, if memory serves me, transactions do not work for creating/deleting tables.Faced a similar problem when creating tables, for example: Create table A, add foreign key A to B.All of this is wrapped in safeUp.If the description of the creation of key B is an error, then table A will create a migration, and a key will be thrown out to create the key.Having edited this migration when trying to use it, it will again take off that table A already exists.



on April 13th, 2020 (9:24 pm)
All coments
This job has not been commented yet.