Skip to content

Conversation

bstanley-pec
Copy link

@bstanley-pec bstanley-pec commented Aug 5, 2025

Description

While testing php artisan migrate:dump with SQLite I discovered an error with the output where both of the first two insert statements had an id of 1, which caused the php artisan migrate:load command to fail. I traced to error to a hard-coded array_slice() call where potentially the current version of SQLite compared to an older version of SQLite produces slightly different output. Making the values of $insert_rows dynamic fixes this issue with the current SQLite version and should also work with older versions as well.

Tests

I added a second migration to specifically highlight this issue and updated all of the dump tests to check that it works correctly with all supported database drivers.

Call outs

I added the ext-mbstring extension to the composer.json file due to various mb_* functions existing in the code base.

…fset and improve tests for insert statements
@qschmick qschmick merged commit 3083e68 into always-open:master Aug 5, 2025
8 checks passed
@bstanley-pec bstanley-pec deleted the fix/sqlite-migrations-table-inserts branch August 5, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants