Django migrations error KeyError: (‘list’, u’user’)

I ran into a similar issue, where db\migrations\operations\models.py was throwing a KeyError after renaming a model through PyCharm’s refactoring (renaming). Apparently the refactoring also took place in the migration file. When opening up the migration file and changing back to the original naming, the makemigrations command worked fine.

How to force migrations to a DB if some tables already exist in Django?

When you apply a migration, Django inserts a row in a table called django_migrations. That’s the only way Django knows which migrations have been applied already and which have not. So the rows in that table have to match the files in your migrations directory. If you’ve lost the migration files after they were applied, … Read more

How to efficiently manage frequent schema changes using sqlalchemy?

Alembic is a new database migrations tool, written by the author of SQLAlchemy. I’ve found it much easier to use than sqlalchemy-migrate. It also works seamlessly with Flask-SQLAlchemy. Auto generate the schema migration script from your SQLAlchemy models: alembic revision –autogenerate -m “description of changes” Then apply the new schema changes to your database: alembic … Read more

Django: dependencies reference nonexistent parent node

Solution – 1 Remove pyc files from your migrations folder. Solution – 2 Need to remove that reference from testBolt.0001_initial by editing migration file. Solution – 3 Remove the new changes from the models and run python manage.py migrate –fake Now again modify your models with new changes Run python manage.py makemigrations And then again … Read more

tech