Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

South 0016 Migration MySQL #129

Closed
mrgix opened this issue Mar 21, 2015 · 9 comments · Fixed by #132
Closed

South 0016 Migration MySQL #129

mrgix opened this issue Mar 21, 2015 · 9 comments · Fixed by #132

Comments

@mrgix
Copy link

mrgix commented Mar 21, 2015

Migration is now working on mysql db.
Changed row 17 and 21 to if connection.vendor not in ['sqlite', 'mysql', ]:

error message:
FATAL ERROR - The following SQL query failed: ALTER TABLE aldryn_newsblog_latestentriesplugin ADD CONSTRAINT app_config_id_refs_id_522159a1 FOREIGN KEY (app_config_id) REFERENCES aldryn_newsblog_newsblogconfig (id);

@mkoistinen
Copy link
Contributor

I'm able to reproduce this issue using MySQL 5.6.22. OP reported he was using 5.6.17 here. OP is running Django 1.6.x and Python 2.7.9.

@Nalanae
Copy link

Nalanae commented Mar 21, 2015

Tested some more with MySQL query logging on. I've taken part of the log that seems to be migration 0016. What I see is that the entire migration is completed, but then the constraint is added again which gives the error and a rollback.

I've tested with MySQL 5.6.23 and 5.5.41, both seem to have the same problems. I use Django 1.6, South 1.0.2 and MySQL-python 1.2.5.

http://pastebin.com/gH8y8nWG

@mkoistinen
Copy link
Contributor

I've now tried it with and without using 'init_command': 'SET storage_engine=INNODB'... no difference. All tests run fine. It'd be easy enough for me to make the change that I suggested to make it work, but I think its more important to understand why. Also, can you supply the output of a pip freeze?

@Nalanae
Copy link

Nalanae commented Mar 21, 2015

Django==1.6.10
MySQL-python==1.2.5
Pillow==2.7.0
South==1.0.2
Unidecode==0.04.17
YURL==0.13
aldryn-apphooks-config==0.1.4
aldryn-boilerplates==0.6
aldryn-categories==0.1.2
aldryn-common==0.1.1
aldryn-newsblog==0.3.0
aldryn-people==0.5
aldryn-reversion==0.0.1
backport-collections==0.1
cmsplugin-filer==0.10.1
django-appconf==1.0.1
django-appdata==0.1.4
django-classy-tags==0.6.1
django-cms==3.0.12
django-filer==0.9.9
django-mptt==0.6.1
django-parler==1.3
django-phonenumber-field==0.7.2
django-polymorphic==0.6.1
django-reversion==1.8.5
django-sekizai==0.8.1
django-sortedm2m==0.9.4
django-taggit==0.12.3
django-treebeard==3.0
djangocms-admin-style==0.2.5
djangocms-text-ckeditor==2.4.3
easy-thumbnails==2.2
html5lib==0.999
phonenumbers==7.0.2
python-dateutil==2.4.1
pytz==2014.10
six==1.9.0
vobject==0.6.6
wheel==0.24.0

@mkoistinen
Copy link
Contributor

@Nalanae are you able to run the tests in the aldryn-newsblog package?

pip install -r test_requirements/django-1.6.txt
./test

@Nalanae
Copy link

Nalanae commented Mar 22, 2015

When I run the tests against SQLite or MySQL they run fine. However, when I check a MySQL query log of just the testrun, I can't find any mention of the problematic constraints. I'll investigate further into the log.

If you want to have a look into the log: https://dl.dropboxusercontent.com/u/6635899/mysql.log.zip

@Nalanae
Copy link

Nalanae commented Mar 22, 2015

When I change the call to djangocms-helper to use migrations I can force the error.

djangocms-helper aldryn_newsblog --cms test --migrate --extra-settings=test_settings $@

@mkoistinen
Copy link
Contributor

@Nalanae, @mrgix Very useful, thanks to both of you.

@mkoistinen
Copy link
Contributor

Should be fixed by #132

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants