- [Django]-Django : mysql : 1045, "Access denied for user
- [Django]-How can I access environment variables directly in a Django template?
- [Django]-No module named 'polls.apps.PollsConfigdjango'; Django project tutorial 2
7👍
If you are using SQLAlchemy as your ORM then the de facto standard is Alembic.
Another alternative that haven’t been mentioned is yoyo-migrations.
- [Django]-Add rich text format functionality to django TextField
- [Django]-Filter Django objects where related object exists
- [Django]-Multiple decorators for a view in Django: Execution order
3👍
We use Django at work, and we’ve been using dmigrations. While it has its quirks, it’s been useful so far. Some features:
- It uses a table in the database to keep track of which migrations have been applied.
- Because it knows which ones have been applied, you can migrate up and back down.
- It integrates with
manage.py
as a command. - The individual migration scripts are Python, but if your migration logic is pure SQL, dmigrations makes it easy to just can the SQL and have it executed.
One problem is that it only currently supports MySQL. However, one of our guys make a local hack to it to support PostgreSQL, which we use. As I recall, the hack wasn’t all that extensive, so it shouldn’t be terribly difficult to hack it up to support other RDBMSs.
- [Django]-How to render individual radio button choices in Django?
- [Django]-AttributeError while using Django Rest Framework with serializers
- [Django]-Django – query filter on manytomany is empty
2👍
I like django-evolution:
pros:
- clean design
- no SQL needed
- flexible
- trivial to install
- easy to use
cons:
- migrations are not fixed in the codebase
- a risk exists of accidently running a migration twice
- [Django]-In Django models.py, what's the difference between default, null, and blank?
- [Django]-Django REST Framework custom fields validation
- [Django]-How to suppress the deprecation warnings in Django?
1👍
Besides South, dmigrations, django-evolution, and Migratory I thought I would add simplemigrations as another tool I’ve seen for automating Django migrations.
I’ve used three of these in the past but do migrations by hand now. I’m thinking about trying South again due to the latest features added.
- [Django]-Django Admin ManyToManyField
- [Django]-Os.getcwd() vs os.path.abspath(os.path.dirname(__file__))
- [Django]-Django FileField upload is not working for me
1👍
Just to note that since 2009, pretty much every project mentioned here other than South is dead. South is the de facto standard, for better or worse.
- [Django]-Cannot update a query once a slice has been taken
- [Django]-Django – pisa : adding images to PDF output
- [Django]-Django: Best way to unit-test an abstract model
0👍
I’ve been using simple-db-migrate
Pros:
- it allows me to rollback the migrations (IDK if other do this too).
- integrates with manage.py
- everyone that knows SQL can create a migration
- it doesn’t run a migration twice: the application writes the migration information(timestamp, query, etc.) on a table
Cons:
- if you add a migration with a lower timestamp than the latest migration installed, this migration doesn’t run
- Only MySQL is supported
- [Django]-Getting model ContentType in migration – Django 1.7
- [Django]-WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)
- [Django]-Django migration error :you cannot alter to or from M2M fields, or add or remove through= on M2M fields