0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravel6.xカラムタイプ変更エラー

Posted at

結論

composer updateでバージョンアップする。
laravel 6.18.10 -> 6.18.13

対象コード

マイグレーションでカラムタイプを変更しようとしたときに発生

Schema::table('facilities', function (Blueprint $table) {
            $table->string('phone')->change();
        });

ここのスキーマがcreateとかになっている時も似たようなエラーが出るので注意

表示されるエラー

Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: 
Syntax error or access violation: 1064 You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`' at line 1")

関連Issue

Laravel側でdbalの使い方がよくないから起きてるみたい
https://github.com/doctrine/dbal/issues/3714
Laravelサイドでフィックスされたみたい
https://github.com/laravel/framework/issues/30539#issuecomment-622082778

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?