django - Deleted migration files- how to makemigrations without losing data -
i changed field on model class (which has no classes point to it, 1 foreign key pointing out of it). somehow, stuffed migrations , keeps saying "django.db.migrations.graph.nodenotfounderror:" looking migration files not exist.
i accidentally deleted several files in 'migrations' folder.
my database contains lot of data, , not want break it.
will lose data if i:
remove table caused problem in first place (psql, \d, drop table tablename)
delete migration files
re run migration start?
./manage.py makemigrations
./manage.py migrate
can recommend way of fixing this?
here traceback: http://dpaste.com/0y1ydxs
aren't using git can migration files back? if not, install , use it, starting now
i suggest:
- make backup/dump of database first, in case goes wrong
- delete migrations
- empty migration table in psql
- call
makemigrations
- call
migrate --fake-initial
Comments
Post a Comment