Skip to content
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

Combine dropColumn calls in up migration #13

Merged
merged 1 commit into from
Feb 8, 2022
Merged

Combine dropColumn calls in up migration #13

merged 1 commit into from
Feb 8, 2022

Conversation

pboivin
Copy link
Contributor

@pboivin pboivin commented Feb 7, 2022

Hi CWS Digital,

I was working on some feature tests for an application using twill-metadata and got the following error while running the migrations on SQLite:

BadMethodCallException: SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification.

/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:156
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:129
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:108
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:364
/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:211
/var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261
/var/www/html/vendor/cwsdigital/twill-metadata/src/migrations/2021_09_22_105532_remove_non_translated_columns_on_metadata_table.php:22
...

I was not aware of this limitation with SQLite, but it seems to be a known issue in the Laravel community. I was able to find a quick workaround in this GitHub issue: laravel/framework#2979 (comment)

Combining all column names into a single dropColumn() call works beautifully.

Let me know if I can provide any more information.

@pauldwight pauldwight merged commit 8583a7a into cwsdigital:v1.x Feb 8, 2022
@pauldwight
Copy link
Collaborator

Thanks @pboivin good spot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants