If your project is not deployed to production yet, the easiest solution is
to delete the whole existing database (sqlite db file or postgres/mysql
database) and try to apply the migrations.

But if the project is already in the production, you would need to be
careful with that. I would suggest
1. Make a backup of your data
2. Delete the tables of admin, auth and django_migration apps.
3. Apply the migrations
4. Insert the old users into your new custom user table.

On Mon, Aug 10, 2020 at 12:01 AM Ayser shuhaib <embedded.mana...@gmail.com>
wrote:

> Truro delete the files inside the migrations folder then run The
> makemigrations command then migrate
>
> On Sun, 09 Aug 2020 at 19:58, FIRDOUS BHAT <frdsbh...@gmail.com> wrote:
>
>> django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
>> admin.0001_initial is applied before its dependency users.0001_initial on
>> database 'default'.
>>
>> --
>> 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/94c323ed-996c-40a1-bb34-18339ee8d47co%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/94c323ed-996c-40a1-bb34-18339ee8d47co%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/CAE0AZG%2BV_HSWUMSLARpDPJ1aWB0uea8o0Wvm7gmNVt5016Tfuw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAE0AZG%2BV_HSWUMSLARpDPJ1aWB0uea8o0Wvm7gmNVt5016Tfuw%40mail.gmail.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/CAFzgvyFZxbnSPBu61vaP%3D4TVvFiH4WVF915osfP0h9Fm_-1bDw%40mail.gmail.com.

Reply via email to