Yes, this is certainly possible. Migrations are just python scripts that follow a specific protocol/api that is detailed in the excellent django documentation. You can insert your own hand crafted migrations to handle many cases that can cater for a variety of use cases.
i would suggest though an alternative and easier approach. add a new field with a different name and change your code accordingly. once the current field is no longer of use, remove it. HTH /d On 4 September 2023 at 10:20:44, sebasti...@gmail.com ( sebastian.ju...@gmail.com) wrote: > Hallo, > > sometimes it exists the problem that i change a field to another fieldtype > then i want for example to move existing data in column to another column > before migration of this field are running. Is there a possibility to > execute a script before a field through migration are running? > > Regards > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/ec295628-aea3-4fb0-83d9-c5efda400729n%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/ec295628-aea3-4fb0-83d9-c5efda400729n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE5VhgV6ZjhTEr3ZDBTTSJs-XOv_2h_4zEg%2B6xyYOKbQsVc4yg%40mail.gmail.com.