Support the ongoing development of Laravel.io →
posted 5 years ago
Database

For some reason this migration:

Schema::table('map_channel_campaigns', function (Blueprint $table) {
            $table->bigInteger('datasource_id')->unsigned()->change();
        });

Tries to produce invalid SQL, like this:

ALTER TABLE map_channel_campaigns CHANGE datasource_id datasource_id BIGINT UNSIGNED CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci`

Why is it trying to add CHARACTER SET to that part of an alter table statement when it's not valid SQL?

This application was originally Laravel 5.2 and has been shifted - using Laravel Shift - to 6.4.

I think this is a Doctrine/DBAL bug. Shouldn't the SQL really be:

ALTER TABLE map_channel_campaigns CHANGE datasource_id datasource_id BIGINT UNSIGNED DEFAULT NULL COLLATE `utf8_general_ci`, CHARACTER SET `utf8` 
Last updated 2 years ago.
0

Your issue is most likely caused by a bug in the most recent version of the doctrine/dbal package. The issue was introduced with v2.10.0.

You can always try to downgrade the package in your composer.json to v2.9.3 it should work just fine.

See the offical issue here: https://github.com/doctrine/dbal/issues/3714

Last updated 5 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.