I was searching the internet for some way to run Transactions for operations of type ALTER TABLE
or CREATE TABLE
in Mysql . This is because in a system of ours, we used Migrations and wanted that, if something went wrong in creating the table, the changes had a rollback.
I ended up finding that can not do this in Mysql.
I saw this in SOEN's Answer .
(If someone can translate, be grateful, but could understand more or less).
Some statements can not be rolled back. In general, these include data definition language (DDL) statements, such as those that create or drop databases, those that create, drop, or alter tables or stored routines.
But then there were some doubts:
-
Why is there such a limitation on structural table changes?