Re: Django "makemigrations -- update" donot working

2023-04-11 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Indeed, David is right. The --update flag is intended for developing a
feature branch and adding extra changes to a work-in-progress migration.
This is why it requires the migration to not be applied.

On Sun, Apr 9, 2023 at 9:20 PM David Wobrock 
wrote:

> Hi,
>
> As you can see, the error message seems quite clear:
> > Cannot update applied migration 'authentication.0001_initial'.
> One cannot edit a migration that has already been applied.
> To update it, you can undo it by running "migrate authentication zero" and
> then run "makemigrations --update" again.
>
> I do not think it's a bug in Django.
>
> Cheers,
> David
>
> Le sam. 8 avr. 2023 à 16:50, Muhammad Juwaini Abdul Rahman <
> juwa...@gmail.com> a écrit :
>
>> Do you need that '--update' parameter?
>>
>> On Fri, 7 Apr 2023 at 05:57, Saifullah Shahen 
>> wrote:
>>
>>> in my custom user model, initially, my model looks like this
>>>
>>> class User(AbstractUser, BaseModelWithUUID):
>>> phone = models.CharField(max_length=11,
>>> validators=[validate_phone_number])
>>> I do command "makemigrations" which create a initial migration file
>>>
>>> but after updating my model like this
>>>
>>> class User(AbstractUser, BaseModelWithUUID):
>>> phone = models.CharField(max_length=11,
>>> validators=[validate_phone_number])
>>> name = models.CharField(max_length=255)
>>>
>>> after adding a field "name" when i run "makemigrations --update" it
>>> shows a error:
>>>
>>> CommandError: Cannot update applied migration
>>> 'authentication.0001_initial'.
>>>
>>> --
>>> 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/793fee18-1231-456b-8d91-f976bebad5e2n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/CAFKhtoS4wer5PRzA-G%3D1MvOMV8S2oGnMRZ83PTQ6fy3DukWzdQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAHS_w9bXLJ0Cj30yU%2BLw%2BATofw%2B-kkeH2NYF8YCcv6ax303xeg%40mail.gmail.com
> 
> .
>

-- 
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/CAMyDDM0dVF5qgiPGHTo-MND86PAPVKwhmm4ROw_pCnStJbgqTw%40mail.gmail.com.


Re: Django "makemigrations -- update" donot working

2023-04-09 Thread David Wobrock
Hi,

As you can see, the error message seems quite clear:
> Cannot update applied migration 'authentication.0001_initial'.
One cannot edit a migration that has already been applied.
To update it, you can undo it by running "migrate authentication zero" and
then run "makemigrations --update" again.

I do not think it's a bug in Django.

Cheers,
David

Le sam. 8 avr. 2023 à 16:50, Muhammad Juwaini Abdul Rahman <
juwa...@gmail.com> a écrit :

> Do you need that '--update' parameter?
>
> On Fri, 7 Apr 2023 at 05:57, Saifullah Shahen 
> wrote:
>
>> in my custom user model, initially, my model looks like this
>>
>> class User(AbstractUser, BaseModelWithUUID):
>> phone = models.CharField(max_length=11,
>> validators=[validate_phone_number])
>> I do command "makemigrations" which create a initial migration file
>>
>> but after updating my model like this
>>
>> class User(AbstractUser, BaseModelWithUUID):
>> phone = models.CharField(max_length=11,
>> validators=[validate_phone_number])
>> name = models.CharField(max_length=255)
>>
>> after adding a field "name" when i run "makemigrations --update" it shows
>> a error:
>>
>> CommandError: Cannot update applied migration
>> 'authentication.0001_initial'.
>>
>> --
>> 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/793fee18-1231-456b-8d91-f976bebad5e2n%40googlegroups.com
>> 
>> .
>>
> --
> 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/CAFKhtoS4wer5PRzA-G%3D1MvOMV8S2oGnMRZ83PTQ6fy3DukWzdQ%40mail.gmail.com
> 
> .
>

-- 
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/CAHS_w9bXLJ0Cj30yU%2BLw%2BATofw%2B-kkeH2NYF8YCcv6ax303xeg%40mail.gmail.com.


Re: Django "makemigrations -- update" donot working

2023-04-08 Thread Muhammad Juwaini Abdul Rahman
Do you need that '--update' parameter?

On Fri, 7 Apr 2023 at 05:57, Saifullah Shahen  wrote:

> in my custom user model, initially, my model looks like this
>
> class User(AbstractUser, BaseModelWithUUID):
> phone = models.CharField(max_length=11,
> validators=[validate_phone_number])
> I do command "makemigrations" which create a initial migration file
>
> but after updating my model like this
>
> class User(AbstractUser, BaseModelWithUUID):
> phone = models.CharField(max_length=11,
> validators=[validate_phone_number])
> name = models.CharField(max_length=255)
>
> after adding a field "name" when i run "makemigrations --update" it shows
> a error:
>
> CommandError: Cannot update applied migration
> 'authentication.0001_initial'.
>
> --
> 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/793fee18-1231-456b-8d91-f976bebad5e2n%40googlegroups.com
> 
> .
>

-- 
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/CAFKhtoS4wer5PRzA-G%3D1MvOMV8S2oGnMRZ83PTQ6fy3DukWzdQ%40mail.gmail.com.


Re: Django "makemigrations -- update" donot working

2023-04-07 Thread Dipankar
Please follow https://docs.djangoproject.com/en/4.1/topics/auth/customizing/

On Fri, Apr 7, 2023 at 3:27 AM Saifullah Shahen 
wrote:

> in my custom user model, initially, my model looks like this
>
> class User(AbstractUser, BaseModelWithUUID):
> phone = models.CharField(max_length=11,
> validators=[validate_phone_number])
> I do command "makemigrations" which create a initial migration file
>
> but after updating my model like this
>
> class User(AbstractUser, BaseModelWithUUID):
> phone = models.CharField(max_length=11,
> validators=[validate_phone_number])
> name = models.CharField(max_length=255)
>
> after adding a field "name" when i run "makemigrations --update" it shows
> a error:
>
> CommandError: Cannot update applied migration
> 'authentication.0001_initial'.
>
> --
> 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/793fee18-1231-456b-8d91-f976bebad5e2n%40googlegroups.com
> 
> .
>


-- 
Warm Regards,
Dipankar B.

-- 
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/CAFdBwp8DK5SgXgzQde9bS_Uf8tMvAFdfKQR%2BTgecyptYvqeA%3Dg%40mail.gmail.com.


Django "makemigrations -- update" donot working

2023-04-06 Thread Saifullah Shahen
in my custom user model, initially, my model looks like this

class User(AbstractUser, BaseModelWithUUID):
phone = models.CharField(max_length=11, 
validators=[validate_phone_number])
I do command "makemigrations" which create a initial migration file

but after updating my model like this

class User(AbstractUser, BaseModelWithUUID):
phone = models.CharField(max_length=11, 
validators=[validate_phone_number])
name = models.CharField(max_length=255)

after adding a field "name" when i run "makemigrations --update" it shows a 
error:

CommandError: Cannot update applied migration 'authentication.0001_initial'.

-- 
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/793fee18-1231-456b-8d91-f976bebad5e2n%40googlegroups.com.