[Django] #33576: CustomUser: InconsistentMigrationHistory in multiple databases

2 views
Skip to first unread message

Django

unread,
Mar 14, 2022, 9:06:40 AM3/14/22
to django-...@googlegroups.com
#33576: CustomUser: InconsistentMigrationHistory in multiple databases
--------------------------------------+------------------------
Reporter: Artem | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+------------------------
Hello.

I have multiple databases and use it in 2 project.

First project:

{{{
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'main-admin',
},
'main': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'main',
},
}
}}}

Secondary project:

{{{
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'articles-admin',
},
'articles': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'articles',
},
'main': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'main',
},
}
}}}

I am config routers.
For example: https://monosnap.com/file/sblvTdWM9tmSx1DFxPhcI656SyRuHW

In first project I create database "main" and apply all migrations.
In secondary project I create CustomUser and apply migrations.

Then I create new migration in secondary project then look:
InconsistentMigrationHistory: Migration admin.0001_initial is applied
before its dependency person.0001_initial on database 'main'

I need create next project with custom user and database "main".
But I will get an error again if now I delete the base and recreate it on
the next project that will contain the base "main"

Main database migration sequence is not important, but every time I
connect it to the next project and create a custom user, I will get an
error

--
Ticket URL: <https://code.djangoproject.com/ticket/33576>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages