In the initial stages of my project I'm making a lot of changes to the models and thus I've ended up with a lot of south migrations being generated for my apps. Is it possible to consolidate them in any way before going to my production server to perform the migrations so I don't have like a million migrations for each app? And if so, how would I go about doing that?
相关问题
- Django __str__ returned non-string (type NoneType)
- Django & Amazon SES SMTP. Cannot send email
- Django check user group permissions
- Django restrict pages to certain users
- UnicodeEncodeError with attach_file on EmailMessag
相关文章
- Profiling Django with PyCharm
- Why doesn't Django enforce my unique_together
- MultiValueDictKeyError in Django admin
- Django/Heroku: FATAL: too many connections for rol
- Connection pooling vs persist connection mysqli
- Django is sooo slow? errno 32 broken pipe? dcramer
- Django: Replacement for the default ManyToMany Wid
- Upgrading transaction.commit_manually() to Django
Since this is a development environment, this is how I do it (using SQLite, see below for other SQL servers):
When using "proper" SQL servers, just keep two databases: production and development. Change project settings to point to production database instead of renaming in step 3. Also, you can skip step 4.
You could always delete the existing migrations and create a new "initial" migration.
To do this, you will need to:
./manage.py convert_to_south myapp
This will leave you with a single migration corresponding to your app's state current state.
Alternatively, you can always pack your latest migrations together:
./manage.py schemamigration myapp
This will create a new migration that will correspond to the migrations you removed.
Both of these will likely mess up your development DB.