yii2-filemanager icon indicating copy to clipboard operation
yii2-filemanager copied to clipboard

Mysql primary key is too long

Open innerdev opened this issue 8 years ago • 1 comments

Hello. I can't apply this migration on my production server:

https://github.com/PendalF89/yii2-filemanager/blob/master/migrations/m141203_173402_create_filemanager_owners_table.php

MySQL version:

~$ mysql --version
mysql  Ver 14.14 Distrib 5.5.36-34.0, for debian-linux-gnu (x86_64) using  EditLine wrapper

Error I got when tried to apply migraion:

*** applying m141203_173402_create_filemanager_owners_table

create table filemanager_owners ...
Exception 'yii\db\Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

The SQL being executed was: CREATE TABLE `filemanager_owners` (
    `mediafile_id` int(11) NOT NULL,
    `owner_id` int(11) NOT NULL,
    `owner` varchar(255) NOT NULL,
    `owner_attribute` varchar(255) NOT NULL,
    PRIMARY KEY (`mediafile_id`, `owner_id`, `owner`, `owner_attribute`)
)'

What I can do? I can't change server because it's my client's server.

innerdev avatar Mar 29 '16 18:03 innerdev

BTW, it's totally fine on my localhost. MySQL version:

$ mysql --version mysql Ver 14.14 Distrib 5.6.28, for debian-linux-gnu (x86_64) using EditLine wrapper

innerdev avatar Mar 29 '16 19:03 innerdev