qizhiyi / sqlalchemy-migrate

Automatically exported from code.google.com/p/sqlalchemy-migrate
MIT License
0 stars 0 forks source link

sqlalchemy-migrate does not work on mysql 5.5 with utf-8 #145

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Install mysql 5.5, set your default character set to utf8mb4
2. Run managedb.py version_control

What is the expected output? What do you see instead?

I expected it to install the version control table, instead, I get this error:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1071, 'Specified key was 
too long; max key length is 767 bytes', None) u'\nCREATE TABLE migrate_version 
(\n\trepository_id VARCHAR(250) NOT NULL, \n\trepository_path TEXT, \n\tversion 
INTEGER, \n\tPRIMARY KEY (repository_id)\n)\n\n' ()

What version of the product are you using? On what operating system?

sqlalchemy-migrate==0.7.2
mysql 5.5 (percona build 24)
ubuntu 11.10

Please provide any additional information below.

utf8mb4 is the new utf-8 support in mysql 5.5 that supports 4 byte utf-8 
characters.

Original issue reported on code.google.com by neilku...@gmail.com on 15 Feb 2012 at 9:44

GoogleCodeExporter commented 8 years ago
Also, this is using the oursql (0.9.3) driver.

Original comment by neilku...@gmail.com on 15 Feb 2012 at 10:18

GoogleCodeExporter commented 8 years ago
I changed the character set to utf8 and was able to successfully make it work.

So to confirm, the issue exists for the newer utf-8 character set - utf8mb4.

Prior to mysql 5.5, mysql's utf-8 support was 1-3 byte utf-8 characters. Mysql 
5.5 introduced the newer utf8mb4 character set that supports more unicode code 
points (which is important for things like emoji or some chinese characters).

Original comment by neilku...@gmail.com on 15 Feb 2012 at 10:23