nephila / djangocms-page-meta

OpenGraph, Twitter Card and Google+ snippet tags for django CMS 3 pages
https://djangocms-page-meta.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
59 stars 64 forks source link

Specified key was too long; max key length is 767 bytes #53

Closed thalesac closed 8 years ago

thalesac commented 8 years ago

Hi, I'm getting this error when I run migrate. Probably is due to the table name length.

Mysql 5.6.30 Charcode: UTF-8 django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes') Django 1.9

yakky commented 8 years ago

@thalesac thanks for reporting this: which is the exact collation for the mysql database and the exact migration number that fails?

thalesac commented 8 years ago

Hi @yakky thank you for replying. The collation is utf8_general_ci The migration probably is: Applying djangocms_page_meta.0006_auto_20160423_1859...Traceback (most recent call last):

yakky commented 8 years ago

@thalesac could you test this version https://github.com/nephila/djangocms-page-meta/archive/change_migrations.zip ? This is not a complete fix (admin may look awkward) but just to investigate if I found out the issue

thalesac commented 8 years ago

Hi @yakky , I've tested and it didn't work. If you setup a branch for me I can test quickly. Perhaps is the ´'genericmetaattribute'´?

yakky commented 8 years ago

@thalesac could you test the branch "drop_unique"?

thalesac commented 8 years ago

Sorry for the delay @yakky Now I've got a different exception:

` Running migrations: Rendering model states... DONE Applying djangocms_page_meta.0006_auto_20160423_1859...Traceback (most recent call last):

(...) File "/mnt/c/Users/thales/projetos/travelo/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint') `

leesolway commented 8 years ago

Applying djangocms_page_meta.0006_auto_20160423_1859...Traceback (most recent call last): django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 3072 bytes')

Same issue as reported above with MySQL version 5.7

yakky commented 8 years ago

@leesolway @thalesac could you test latest drop_unique commit? I've been unable to reproduce both errors with mysqlclient==1.3.7, mysql 5.6.30, database created with create database pagemeta2 collate ='utf8_general_ci'; and storage set to innodb;

thalesac commented 8 years ago

Hi @yakky , I've tested and now it seems to work fine. I've deleted all tables / migrations and have run 'migrate' again. Thanks for your fix.

yakky commented 8 years ago

@thalesac thanks for the update. I will release a fixed version soon @leesolway did you had the chance to test it?

leesolway commented 8 years ago

@yakky I can confirm that the drop_unique branch is working on my setup. Thanks.

yakky commented 8 years ago

@leesolway thanks. Will release a fixed version later today. Thanks both for your testing and feedback