Hi all,

I'd like to get your feedback on supporting non-atomic migrations in Django.

Database transactions are always wrapped in transactions (on DBs that 
support transactional DDL like Postgres). Generally this is a good idea. 

However, one can't do batched updates in data migrations which is essential 
for performing changes on big tables on a live DB [1]. It's also not 
possible to create indexes concurrently on Postgres from inside a 
transaction.

Therefore, I'd like to have support for non-atomic migrations in Django 
because it's pretty messy to work around not having proper support for that 
[2].

Here's a proof-of-concept implementation [3] of exempting specific 
migrations from being wrapped in a transaction by setting `atomic = False` 
on the migration:

https://github.com/django/django/compare/master...Ableton:non-atomic-migrations

Do you agree that non-atomic migrations should be supported by Django?

Is setting an `atomic` property on a migration a good API for that?

If there's a chance this will be merged, I'd add documentation, incorporate 
your feedback, and open a ticket or PR.

Thanks,
Ludwig

[1] http://pankrat.github.io/2015/django-migrations-without-downtimes/
[2] 
http://stackoverflow.com/questions/31247810/commit-manually-in-django-data-migration
[3] 
https://github.com/django/django/compare/master...Ableton:non-atomic-migrations

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c062736d-2ebc-42cd-83a5-fe4d064cb24e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to