Closed FIRDOUS-BHAT closed 3 years ago
I too deleted the database and now I am not sure how I can restore the functionality again. I still have the migration files but the aerich table is empty (it still does exist though).
How can I make aerich work again?
@FIRDOUS-BHAT Have you found a fix for your issue?
@long2ice Would you be so kind and give me some pointers how I can restore the db entries from aerich? Maybe there is a fail save need that will restore the db entry based on the migration files?
You can drop aerich
table, delete migrations/{app}
dir, and the rerun aerich init-db
Thank you for your quick reply! I can do that - but won't this affect my production database? Because there the db table does already exist.
That won't affect, aerich init-db
only generate table create sql like create table if not exists...
, on the safe side, you can review sql generated first.
Thank you very much for your help!
I was getting some error like this
tortoise.exceptions.ConfigurationError: Can't create schema due to cyclic fk references
while migrating the new schema changes. In order to get rid off from this error I removed aerich table from database and removed migrations folder as well now after initializing the migrations again withaerich init-db
andaerich migrate
, I'm now getting this errorAttributeError: 'NoneType' object has no attribute 'pop'
on line no. /aerich/migrate.py line 170, in diff_models old_models.pop(_aerich, None)