tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
820 stars 94 forks source link

Running aerich on a nonexisting db causes OperationalError #168

Open spacemanspiff2007 opened 3 years ago

spacemanspiff2007 commented 3 years ago

If the db does not exist yet (because the application is started for the first time) running

aerich --app MyApp upgrade

will result in

    raise OperationalError(exc)
tortoise.exceptions.OperationalError: no such table: aerich

I don't know what the correct behavior is? Maybe check if the db file already exists and if not do nothing?

FIRDOUS-BHAT commented 3 years ago

what was the output while you initialized aerich?

spacemanspiff2007 commented 3 years ago

It's creating the .ini file and the models in the .migrations folder just fine. I then move my app (including the .ini and migration files but without the .db file) to a different machine and run the above command which then subsequently fails.