Dbal: ALTER TABLE adds COLLATION to changes on numeric columns

Created on 4 Nov 2019  路  4Comments  路  Source: doctrine/dbal

BC Break Report

| Q | A
|------------ | ------
| BC Break | yes
| Version | 2.10.0

Summary

The latest change in https://github.com/doctrine/dbal/pull/3668 by @staudenmeir seem to have broken my migrations in MySQL that don't update text columns.

Previous behaviour

ALTER TABLE user_details 
CHANGE vat_amount vat_amount NUMERIC(8, 2) DEFAULT '0' NOT NULL, 
CHANGE vat_included vat_included TINYINT (1) DEFAULT '0' NOT NULL

Current behavior

ALTER TABLE user_details 
CHANGE vat_amount vat_amount NUMERIC(8, 2) DEFAULT '0' NOT NULL, 
CHANGE vat_included vat_included TINYINT (1) CHARACTER SET utf8mb4 DEFAULT '0' NOT NULL COLLATE `utf8mb4_unicode_ci`

How to reproduce

In a Laravel 6 project:

Schema::table('user_details', static function (Blueprint $table) {
    $table->decimal('vat_amount', 8, 2)->default(0)->change();
    $table->boolean('vat_included')->nullable(false)->default(false)->change();
});
Bug Columns Duplicate MySQL Schema Schema Definition Schema Introspection Schema Managers

All 4 comments

duplicate of #3714

Dang, I had this open half an hour ago, went to lunch and submitted when I came back haha.

Haha submitted before lunch :p

s'alright - closing here meanwhile.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidbarratt picture davidbarratt  路  4Comments

feridmovsumov picture feridmovsumov  路  5Comments

ghost picture ghost  路  6Comments

photodude picture photodude  路  3Comments

arima-ryunosuke picture arima-ryunosuke  路  5Comments