samedi 1 août 2020

how to handle add column migration in testing laravel

assuming that I have a code that is running on production and because of this I can not alter the same migration file, So I add a new migration file for adding my new column, but SQLite is throwing error. I have searched but did not find any good solution, does anyone knows a way to fix this and at the same time run tests on memory so tests are working fast. thankyou

The SQLite exception is like

PDOException: SQLSTATE[HY000]: General error: 1 near "CHANGE": syntax error

Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1 near "CHANGE": syntax error (SQL: ALTER TABLE files CHANGE `type` `type` ENUM('avatar','image','video') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'avatar,image,video')

Aucun commentaire:

Enregistrer un commentaire