Closed CortexPE closed 1 year ago
Figured that the least invasive change would be to add rstrip(";")
to the end of create_table
, since... Upon skimming through the codebase, it doesn't seem like anything else has this issue (because they're templated without semicolons) but I'm also not 100% sure
Will open a PR with the change, please review it.
This took me a while to find where the issue occurs because the queries worked everywhere else EXCEPT
aerich upgrade
, I'm also new toaerich
andtortoise-orm
.Despite being wrapped in an
in_transaction
context manager, it didn't rollback... it still created thechannels
table (cuz it's a DDL statement)... Perhaps a way to backup and restore everything in the target database?? Otherwise I just can't afford to let errors like this happen on a production environment without a definite way to scrap everything and restore to what is essentially a snapshot (withoutmysqldump
).The deepest my knowledge goes about this issue is that the code generated at this point already has a semicolon (printed below):
Possibly from the template here
And this code is joining all of them with yet another semicolon, while everything else like the
ALTER TABLE
generator doesn't include one:Hope this helps solve the issue quick!
Version Information:
Python:
3.10.7
MySQL:8.0.30
aerich:0.7.1
Produced file:
Error: