mirror of
https://github.com/immich-app/drift.git
synced 2026-09-30 13:22:57 +08:00
Document schema export changes
This commit is contained in:
@@ -81,13 +81,18 @@ If drift is unable to extract the version from your `schemaVersion` getter, prov
|
||||
$ dart run drift_dev schema dump lib/database/database.dart drift_schemas/drift_schema_v3.json
|
||||
```
|
||||
|
||||
!!! success "<i class="fas fa-lightbulb"></i> Dumping a database"
|
||||
!!! tip "Dumping a database"
|
||||
|
||||
|
||||
If, instead of exporting the schema of a database class, you want to export the schema of an existing sqlite3
|
||||
database file, you can do that as well! `drift_dev schema dump` recognizes a sqlite3 database file as its first
|
||||
argument and can extract the relevant schema from there.
|
||||
|
||||
The goal of these exported schemas is to match the actual `CREATE` statements making up your database.
|
||||
For this reason, some columns like booleans and date time values get generated as the inner SQL type.
|
||||
Using the actual source of truth as a snapshot instead of higher-level drift types makes exported schemas more
|
||||
resilient to changes in your app or drift that could affect how the schema gets generated.
|
||||
|
||||
## What next?
|
||||
|
||||
Having exported your schema versions into files like this, drift tools are able
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user