You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQLite schema dumps generated using Laravel's schema:dump command include CREATE TABLE statements for SQLite's internal schema objects, like sqlite_stat1, sqlite_stat4, etc.
"Application" code (anything external to SQLite itself) is not allowed to create these tables, so dumps that include these statements always error.
A fix for this should hopefully be as simple as excluding those tables from the dump, and I'll try that and submit a PR to fix this.
Run the pragma optimize; command in the SQLite shell or with DB:statement('pragma optimize;').
Run php artisan schema:dump --prune.
Attempt to load the generated schema, for example by running tests that migrate the database.
The load command fails with an error like:
Parse error near line 15: object name reserved for internal use: sqlite_stat1
Parse error near line 16: object name reserved for internal use: sqlite_stat4
The text was updated successfully, but these errors were encountered:
Laravel Version
11.15.0
PHP Version
8.3.7
Database Driver & Version
SQLite 3.46.0
Description
SQLite schema dumps generated using Laravel's
schema:dump
command includeCREATE TABLE
statements for SQLite's internal schema objects, likesqlite_stat1
,sqlite_stat4
, etc."Application" code (anything external to SQLite itself) is not allowed to create these tables, so dumps that include these statements always error.
A fix for this should hopefully be as simple as excluding those tables from the dump, and I'll try that and submit a PR to fix this.
Steps To Reproduce
Reproduction: bakerkretzmar/sqlite-internal-schema-objects@3783563
pragma optimize;
command in the SQLite shell or withDB:statement('pragma optimize;')
.php artisan schema:dump --prune
.The load command fails with an error like:
The text was updated successfully, but these errors were encountered: