aerich icon indicating copy to clipboard operation
aerich copied to clipboard

There are errors in the upgrade, but no transaction rollback

Open kulta-jim opened this issue 2 years ago • 1 comments

python===3.10.6 aerich===0.7.1 tortoise-orm[aiomysql]==0.19.3

Aerich has no transaction rollback. I got a duplicate entry error after the first upgrade, and then I manually deleted the duplicate. However, during the second upgrade, it was found that the tables of some databases had been modified in the first upgrade.

kulta-jim avatar Feb 16 '23 03:02 kulta-jim

Did you run the upgrade with the --in-transaction option?

$ aerich upgrade --help
Usage: aerich upgrade [OPTIONS]

  Upgrade to specified version.

Options:
  -i, --in-transaction BOOLEAN  Make migrations in transaction or not. Can be
                                helpful for large migrations or creating
                                concurrent indexes.
  -h, --help                    Show this message and exit.

koffie avatar Aug 02 '23 16:08 koffie