[9.x] Enhance column modifying#44101
[9.x] Enhance column modifying#44101taylorotwell merged 3 commits intolaravel:9.xfrom hafezdivandari:9.x
Conversation
|
Won't this change the behavior for apps who have already run their migrations in production? |
|
@driesvints if they have already run their migrations, how this change the behavior of those apps? Currently, when adding a Schema::create('tests', function (Blueprint $table) {
$table->string('string_to_binary');
$table->integer('integer_to_binary');
$table->binary('binary_column'); // is always `BLOB`
});
Schema::table('tests', function (Blueprint $table) {
$table->binary('string_to_binary')->change(); // changes to `TINYBLOB` because it already has the length of 255.
$table->binary('integer_to_binary')->change(); // changes to `LONGBLOB` because it already has no length.
});Please check this function on Doctrine DBAL; I think it is inconsistent behavior but if you think this is the expected behavior or is a breaking change, I can revert changes to |
|
Their migrations which are part of their app will still be run in development. If they run them in development after this PR is merged, their development databases will be out if sync with production. |
|
OK, I reverted changes on |
This PR does:
doubletinyText.timestamp:TIMESTAMP SET utf8mb4 COLLATE utf8mb4_unicode_ciFix a issue when changing column type tobinary:on MySQL, the type wasLONGBLOBinstead of expectedBLOBPS: I added tests for all adds and changes.
PS: changes to
binaryreverted.