Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: document validateDatabaseSchema support #3318

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/docs/Migrations/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,10 @@ When you use `validateDatabaseSchema`, drift will transparently:
When a mismatch is found, an exception with a message explaining exactly where another value was expected will
be thrown.
This allows you to find issues with your schema migrations quickly.

!!! note "Web support"


`validateDatabaseSchema` is only supported on native platforms (Android, iOS, macOS, Linux and Windows).


3 changes: 3 additions & 0 deletions drift_dev/lib/api/migrations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ extension VerifySelf on GeneratedDatabase {
/// When [validateDropped] is enabled (it is by default), this method also
/// verifies that all schema elements that you've deleted at some point are no
/// longer present in your runtime schema.
///
/// [validateDatabaseSchema] is only supported on native platforms (Android,
/// iOS, macOS, Linux and Windows).
Future<void> validateDatabaseSchema({bool validateDropped = true}) async {
final virtualTables = allTables
.whereType<VirtualTableInfo>()
Expand Down
Loading