Yii2: default generated migration table's 'version' column data length not big enough

Created on 27 Jul 2017  路  6Comments  路  Source: yiisoft/yii2

What steps will reproduce the problem?

the default generated migration table with its "version" column set to varchar(180), but when we create a long alter table column migration, it will drop some characters, such as the following one:
m170726_070258_add_reqm_source_column_temp_theme_column_baselib_config_column_deploy_date_column_pass_review_column_pass_test_column_rollback_time_column_regular_check_column_to_task

What is the expected result?

right migration apply result

What do you get instead?

migration want to re-apply old ones

workaround:
issue SQL "alter table migration modify version varchar(360);"

Additional info

| Q | A
| ---------------- | ---
| Yii version | 2.0.12
| PHP version | 5.6.30
| Operating system |Mac os 10.9.5

ready for adoption bug

Most helpful comment

How about naming it shorter?

All 6 comments

I think need to limit name and mb truncate migration name during creating migration instead increasing length in DB.

Probably.

yep, migrate controller should validate migration names before inserting into db, not only on create, but in general, to avoid people creating too long names manually.

then how do we implement such "long column change" migration requirement ? by split it into multiple steps to fit the length limit ? one line deal to multiple? i don't think it is a good idea. besides the original column length is not enough, by changing its type to "text" is not a big move.

How about naming it shorter?

i also can't create file longer then 255 symbols through file_put_contents on MacOs

Was this page helpful?
0 / 5 - 0 ratings