Skip to content

fix(doctor): resolve the SQLite database through the framework's own keys - #1397

Merged
geodro merged 1 commit into
mainfrom
fix/1392-sqlite-through-the-declaration
Aug 8, 2026
Merged

fix(doctor): resolve the SQLite database through the framework's own keys#1397
geodro merged 1 commit into
mainfrom
fix/1392-sqlite-through-the-declaration

Conversation

@geodro

@geodro geodro commented Aug 8, 2026

Copy link
Copy Markdown
Member

A Symfony project was reported as having an empty database needing migrations, and clicking the fix ran migrations against a project with no migration classes at all, so Doctrine answered that there were none registered. The database it complained about was a 0-byte file the application never opens; the one the site actually uses was healthy the whole time.

The check read DB_CONNECTION and DB_DATABASE wherever it found them, which are Laravel's key names:

if !strings.EqualFold(envfile.ReadKey(envPath, "DB_CONNECTION"), "sqlite") { return }
dbFile := envfile.ReadKey(envPath, "DB_DATABASE")

A Symfony project keeps its SQLite path inside the DATABASE_URL DSN and declares neither key, so where those keys survived as leftovers from something else they were read as though they meant something.

It reads only keys the project's own framework declares now, taking the whole vocabulary from the definition's service detection rules and vars. A framework declaring the flat pair is read through it exactly as before. A DSN is read as a DSN, so a project genuinely on SQLite through a connection string is found rather than passed over, with Symfony's project-root placeholder resolved away. A framework declaring nothing, or a project with no framework at all, falls back to the convention a bare project follows, since there is no vocabulary to respect.

Reading by declared key also means the format no longer matters, so the check moved out of the dotenv-only gate: a framework configured through a PHP settings file is checked through its own dotted keys, and its database file is found in the same block that names its driver. The app-key and drift checks stay behind that gate, one of them diffing against a committed dotenv example.

checkServerDatabase has the same shape and still reads DB_HOST and DB_DATABASE by name. It is left for its own change.

Refs #1392

…keys

A Symfony project was reported as having an empty database needing migrations, and the fix ran migrations against a project with no migration classes at all, so Doctrine answered that there were none registered. The database it complained about was a 0-byte file the application never opens; the one Symfony actually uses was healthy.

The check read DB_CONNECTION and DB_DATABASE wherever it found them, which are Laravel's key names. A Symfony project keeps its SQLite path inside the DATABASE_URL DSN and declares neither key, so where those keys survived as leftovers from something else they were read as though they meant something.

It reads only keys the project's own framework declares now, taking the whole vocabulary from the definition's service detection rules and vars. A framework declaring the flat pair is read through it as before. A DSN is read as a DSN, so a project genuinely on SQLite through a connection string is found rather than passed over, with Symfony's project-root placeholder resolved away. A framework declaring nothing, or a project with no framework at all, falls back to the convention a bare project follows, since there is no vocabulary to respect.

Reading by declared key also means the format no longer matters, so the check moved out of the dotenv-only gate: a framework configured through a PHP settings file is checked through its own dotted keys, and its database file is found in the same block that names its driver. The app-key and drift checks stay behind that gate, one of them diffing against a committed dotenv example.
@geodro
geodro requested a review from a team as a code owner August 8, 2026 06:45
@geodro
geodro merged commit f3d3efe into main Aug 8, 2026
3 checks passed
@geodro
geodro deleted the fix/1392-sqlite-through-the-declaration branch August 8, 2026 06:57
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.

1 participant