schema-migration

Move models between Django (1.8) apps with required ForeignKey references

淺唱寂寞╮ 提交于 2019-12-03 18:24:28
问题 This is an extension to this question: How to move a model between two Django apps (Django 1.7) I need to move a bunch of models from old_app to new_app . The best answer seems to be Ozan's, but with required foreign key references, things are bit trickier. @halfnibble presents a solution in the comments to Ozan's answer, but I'm still having trouble with the precise order of steps (e.g. when do I copy the models over to new_app , when do I delete the models from old_app , which migrations

Django 1.8 - what's the difference between migrate and makemigrations?

纵饮孤独 提交于 2019-12-03 02:38:56
问题 According to the documentation here: https://docs.djangoproject.com/en/1.8/topics/migrations/ it says: migrate, which is responsible for applying migrations, as well as unapplying and listing their status. and makemigrations, which is responsible for creating new migrations based on the changes you have made to your models. From what I understand, I first do makemigrations to create the migration file and then do migrate to actually apply the migration? Do note though that I just began my

Move Django model from one app to another [duplicate]

☆樱花仙子☆ 提交于 2019-11-30 08:37:07
问题 This question already has answers here : How do I migrate a model out of one django app and into a new one? (7 answers) Closed 5 years ago . I made the stupid mistake of creating too many models in the same Django app, now I want to split it into 3 distinct ones. Problem is: there's already data in production in two customers' sites, so I need to carefully plan any schema/data migration to be done (I'm using django-south). I'm unsure on how to proceed, any advice would be greatly appreciated.

Move models between Django (1.8) apps with required ForeignKey references

青春壹個敷衍的年華 提交于 2019-11-29 20:11:05
This is an extension to this question: How to move a model between two Django apps (Django 1.7) I need to move a bunch of models from old_app to new_app . The best answer seems to be Ozan's , but with required foreign key references, things are bit trickier. @halfnibble presents a solution in the comments to Ozan's answer, but I'm still having trouble with the precise order of steps (e.g. when do I copy the models over to new_app , when do I delete the models from old_app , which migrations will sit in old_app.migrations vs. new_app.migrations , etc.) Any help is much appreciated! Migrating a

Move Django model from one app to another [duplicate]

半腔热情 提交于 2019-11-29 06:56:25
This question already has an answer here: How do I migrate a model out of one django app and into a new one? 7 answers I made the stupid mistake of creating too many models in the same Django app, now I want to split it into 3 distinct ones. Problem is: there's already data in production in two customers' sites, so I need to carefully plan any schema/data migration to be done (I'm using django-south). I'm unsure on how to proceed, any advice would be greatly appreciated. (I'm using PostgreSQL on a Ubuntu server 12.4 LTS, if that's of any relevance) I thought about using db.rename_table , but

What is your favorite solution for managing database migrations in django? [closed]

对着背影说爱祢 提交于 2019-11-27 06:30:37
I quite like Rails' database migration management system. It is not 100% perfect, but it does the trick. Django does not ship with such a database migration system (yet?) but there are a number of open source projects to do just that, such as django-evolution and south for example. So I am wondering, what database migration management solution for django do you prefer? (one option per answer please) I've been using South , but Migratory looks promising as well. Migratory looks nice and simple. We use Django at work, and we've been using dmigrations . While it has its quirks, it's been useful

What is your favorite solution for managing database migrations in django? [closed]

青春壹個敷衍的年華 提交于 2019-11-26 12:02:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I quite like Rails\' database migration management system. It is not 100% perfect, but it does the trick. Django does not ship with such a database migration system (yet?) but there are a number of open source projects to do just that, such as django-evolution and south for example. So I am wondering, what