-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MigrationDiff with a longblob column fails to apply #359
Comments
Is this still an issue with 0.12? |
Hi @dereuromark I've landed here because I was facing the same trouble ^^ Anyway, I think you can close the issue as it was indeed a misuse. When using Mysql adapter, the One must use
I saw you were very active in having it supported in Phynx 😸 To avoid the same trap for binary/blob migration newbies like me, do you think it worth submitting a PR on Phynx to automatically remap 'binary' as 'blob' when limit is greater than 255 ? It won't take much time. Otherwise, migrations plugin docs should be updated maybe ? |
I am not sure if we should make those magic switches for devs. Or this is only an issue in MySQL and thus the shimming would be helpful here? |
I think it only applies to Mysql. At first glance, only mysql_adapter have a blob selector trick around data length. Sqlite also uses blob type but without length and subtypes considerations. By the way, after some testings, it appears that blob subtypes aliases, like It can be very useful to handle it in order to avoid looking each time at bytes length for Mysql blob subtypes. I'm on preparing a PR to Phinx to take all these points in account. Plan to look at the doc also. Feel free to say stop 😄 |
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.6.1
Migrations plugin version: 1.8.1
Bake plugin version (if relevant): 1.7.1
Database server (MySQL, SQLite, Postgres): 5.7.21 MySQL Community Server
PHP Version: PHP 7.2.4
Platform / OS: CentOS release 6.9 (Final) 64
What you did
I've added a "LONGBLOB" column to a table.
Run
./bin/cake bake migration_diff AddContentFieldToFilesTable
Resulting migration is
Tried to apply the migration on another server (same characteristics)
Expected Behavior
Expected the migration to apply successfuly resulting in a new column in a table.
Actual Behavior
Migration failed with the following message.
The text was updated successfully, but these errors were encountered: