-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Malformed SQL generated for MySQL when changing column type. #3813
Comments
Before running the migration and getting the error you've reported, what is the character set for the table and column you are trying to change? And, utf8mb4 is the correct character set you should be using. |
Before running the migration, it was |
I think you should not include default null after the character set. |
Yes, that's also my guess, but I'm not the one including it. Doctrine is generating that query based on the migration I provided in the issue. |
I'm experiencing this issue as well in 2.10.1 - 2.9.3 did not experience this issue. |
Hi, I'm experiencing too this issue. doctrine/dbal:2.10.0 but not occured this problem in doctrine 2.9.3 Print source here.
|
It looks like the issue came from 73f38e7#diff-f8e1d5c54371540dc546d17c426c36e6 - commenting out the |
Thx, this problems exactly happen on this code. |
We experience the same problem using MySQL 5.7 and doctrine/dbal v2.10.1 Schema::table('some_table_name', function (Blueprint $table) {
$table->unsignedSmallInteger('some_column_name')->change()->default(100);
});
|
Closing as a duplicate of #3714. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug Report
Summary
I have a table called
visit_locations
on a MySQL 5.7 database, with alatitude
column I want to change fromSTRING
toFLOAT
.When the migration is run, I always get this error:
Current behavior
The error is thrown.
How to reproduce
I have reproduced it on MySQL 5.7, with a migration like this one:
I have also seen that the SQL generated is this:
If instead I remove the
CHARACTER SET utf8
part, then the instruction works, changing the column type as expected.Maybe this part is not getting placed in the proper position?
Expected behavior
The migration is executed without throwing an error.
The text was updated successfully, but these errors were encountered: