-
reviewed1. First-launch database initialisation UID: SRS-001 RELATIONS (Child): STATEMENT: On first launch, when no database file exists at the configured application data path, the system shall create the local database, apply the current schema version, and create a default local clinic record that serves as the container for locally-created patient records.
RATIONALE: The initialisation establishes the minimum persistent state required for any subsequent clinical operation — without it, patient records cannot be stored and recording sessions cannot be attached to a patient.
TYPE: functional
ACTIVE: true
REVIEWED_HASH: 73a53a6ea2b4546ac329d96363bd39c5485b220a390076754e0ecc52644acf7b
REVIEWED_BY: @DougYoungberg
NOTES: coverage-plan: ST on clean install — fresh workstation, first launch, verify the database file exists at the expected path.
Instantiate AppDatabase against a temporary filesystem path at which no database file exists. Trigger the initialisation pathway by performing any query that forces Drift's onCreate migration to run. Inspect the resulting state of the database on disk and of the seeded tables.
automated
flutter_test
The database file exists at the temporary path after the first query. PRAGMA user_version on the opened database equals the value of AppDatabase.schemaVersion declared in application code. The clinics table contains at least one row whose origin is "local", confirming that the bootstrap seed step executed.
true
e3247b36656d8bfbc5165d261120954881338cfa7421592f73f5a18dd55acbb0
@DougYoungberg
Test harness couples to the StrictDoc item via tags: ['IT-001'] on the flutter_test test entry. Test file location: test/integration/first_launch_db_initialization_integration_test.dart.