-
Notifications
You must be signed in to change notification settings - Fork 92
Multiple MySQL database support #50
Copy link
Copy link
Open
Description
I've got a problem when I try to migrate an auditlogged model that isn't in the same MySQL database as the User table. It creates the table but then can't create the foreign key constraint and raises and IntegrityError
django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint')
Tried with with Django 1.8 on Python 2.7 and Django 1.11 on Python 3.6, MySQL databases require the auditlogged model to be in the same database as the User table. SQLite databases don't have a problem here.
I've made a minimal example gist and hopefully I'm not missing something obvious.
After downloading set up virtual env
virtualenv .env
source .env/bin/activate
pip install -r pip_requirements.txt
Migration of default database
python manage.py migrate
Migrate second database with auditlogged model, raises IntegrityError
python manage.py migrate second --database=second
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels