-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Labels
Description
- Laravel Version: 10.3.3
- PHP Version: 8.2.3
- Database Driver & Version: MYSQL 8.0.32
doctrine/dbal
Version: 3.6.1
Description:
The column type change will not be made during a text column's migration to medium or long text. Keeping the column as a text type.
Stepping through the process, Illuminate\Database\Schema\Grammars\ChangeColumn
class line 44 $tableDiff->isEmpty()
returns true
.
Not sure what other columns this affects. This bug occurred during my migration process to Laravel 9 to 10.
Steps To Reproduce:
- Set MySQL config in
database.php
as follows (based on MySQL8 docker image):
'mysql' => [
'driver' => 'mysql',
'url' => null,
'host' => 'mysql',
'port' => '3306',
'database' => 'test',
'username' => 'root',
'password' => 'root',
'unix_socket' => '',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? [
PDO::MYSQL_ATTR_SSL_CA => null,
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => 0,
] : [],
],
- Create a migration that creates a table with three text columns.
- Create another migration changing these columns:
public function up(): void
{
Schema::table('tableName', static function (Blueprint $table) {
$table->mediumText('col1')->change();
$table->longText('col2')->change();
$table->mediumText('col3')->change();
});
}
- Run migrations.
- Columns are still
text
type.
mreduarankurk91