Hacker News new | ask | show | jobs
by truetuna 3358 days ago
It's been a while since I've used Django but at the time (I think 1.6) I couldn't figure out a way to do a migration like adding a non null column to a decent sized relation 100M records without having the table lock up.

I use flyway now for db migrations and what's great is that I can perform migrations in multiple steps (because it's just SQL). So in this case, I can alter table and add a column with nullable, deploy my app to write to both, migrate data at a later time, deploy app again to stop writing to the old column, update column constraints and remove old column.

Does Django ORM have this kind of flexibility?

1 comments

Yeah you can write raw SQL with Django ORM or in the migrations.