On Sat, Apr 25, 2020 at 5:48 PM Adam Johnson <m...@adamj.eu> wrote:

> Re: Uri:
>
>> If the file name is not like ‘auto’ name with the current date + time, it
>> looks like a migration which was written by a developer.
>>
>
> I think making a distinction between "auto generated" and "hand written"
> migrations is a bad idea. Django's makemigrations is a code generator, but
> as a developer you're still responsible for the code. The autodetector
> isn't perfect, and perhaps never can be. Even "simple" cases like adding a
> through table to a ManyToManyField are autodetected "incorrectly" ( a real
> migration needs SeparateDatabaseAndState
> https://docs.djangoproject.com/en/3.0/howto/writing-migrations/#changing-a-manytomanyfield-to-use-a-through-model
> ).
>
> I fear marking "auto generated" migrations differently would just
> encourage (more) lax use of migrations files without reading their content,
> which invites more risk for data loss and anger with Django for not being
> perfect.
>

As a developer I would like to know who generated the code. If a migration
is auto-generated, I would like to know that. I checked and auto-generated
migrations in my project have a comment such as "# Generated by Django
2.1.15 on 2020-01-21 15:31". In most cases auto-generated migrations are
good and don't need to be edited by a developer. So, I would prefer the
migration file names to be auto-generated too (‘auto’ name with the current
date + time).

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CABD5YeFvWJSotjqhB_L%3Dt9i%3Dx3%3DRt%2Bh-S_gYCAgTV3C8RFMjwg%40mail.gmail.com.

Reply via email to