Hacker News new | past | comments | ask | show | jobs | submit login

Most of my migrations with Django are column renames, column adds, deletions, etc., which seem to fit nicely with this tool, but there are some cases where I want to do some more complex transformation which require running a function using Django's `RunPython()`[0]. For example, combining `firstName` and `lastName` columns into a single `name` column.

How would these changes be accomplished?

[0]: https://docs.djangoproject.com/en/2.1/ref/migration-operatio...




Just create a migration script that mixes (autogenerated) sql and the python you need.


I thought that was the point of migrations in Ruby for Rails, PHP for Laravel, etc. Because raw SQL often lacks the tools to express and coordinate the changes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: