I have a Django app named app1
with models and migrations files.
I renamed this app to app2
and I fixed all imports, urls etc...
I now have a problem with migrations files and data in tables.
How can I write migrations with the correct way to ensure:
- New installation => create the new tables
- Update old versions => create new tables, move data, remove old tables
Note 1: there is several tables with many Foreign Keys.
Here is my progress so far and I am not sure if I am on the good way:
- I removed all older migrations
- I ran
python manage.py makemigrations
to generate new migrations files
After these 2 steps, I can install my application but I still have problems with old version.
Question: What is the best way to migrate data?
Note 2: I don't use South
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…