aerich icon indicating copy to clipboard operation
aerich copied to clipboard

Running aerich on a nonexisting db causes OperationalError

Open spacemanspiff2007 opened this issue 4 years ago • 2 comments

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?

spacemanspiff2007 avatar Jun 14 '21 09:06 spacemanspiff2007

what was the output while you initialized aerich?

FIRDOUS-BHAT avatar Jun 14 '21 13:06 FIRDOUS-BHAT

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.

spacemanspiff2007 avatar Jun 14 '21 13:06 spacemanspiff2007