On 01/22/2014 08:59 AM, Shai Berger wrote: >> This means we're really only left with: >>> 3) The database backend or driver doesn't support altering the schema in a >>> way that would work with Django's schema migrations API. I can't think of >>> any that would be used with Django, but people still use mysql despite its >>> many faults, so anything is possible. >> This one, which seems unlikely. > Actually, SQLite "doesn't support altering the schema in a way that would > work > with Django's schema migrations API". The SQLite backend bends over backwards > to comply; its implementation of "alter column" is "recreate the table, > copying the data". AFAIK it doesn't quite get everything right, even with the > somersaults it pulls; and yet, it's close enough for comfort. What about moving this kind of migration support from database driver to django core as an universal fallback ?
(btw, creating a new table and copying the data is what PostgreSQL does in the background for ALTER TABLE ALTER COLUMN TYPE for many, but not all column type changes) My argument for this is that it is remarkably hard to do schema migrations properly even for backends which "support it". You do not want to end up with 3 days downtime "while the database migrates" because you trusted django to do the right thing and it worked ok in your (small) test database. Automatic migrations are very useful at development time, but need lots of TLC when done in production environment. They are hard enough to orchestrate propery at pure SQL level. Adding an extra layer on top with largely undefined performance characteristics makes things much more complikated still. Just my two 2 cents Cheers -- Hannu Krosing PostgreSQL Consultant Performance, Scalability and High Availability 2ndQuadrant Nordic OÜ -- You received this message because you are subscribed to the Google Groups "Django developers" 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/52E038A9.9020208%40krosing.net. For more options, visit https://groups.google.com/groups/opt_out.