DatabaseMigrationHelper class
Static utility class for database migration lifecycle methods. Provides helper methods to manage database upgrades, foreign keys, and schema validation during migrations.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
doAfterUpgrade(
GeneratedDatabase database) → Future< void> - Executed after database upgrade. Re-enables foreign key constraints and validates them in debug mode.
-
doBeforeOpen(
GeneratedDatabase database) → Future< void> - Executed before database is opened. Enables foreign key constraints and validates database schema.
-
doBeforeUpgrade(
GeneratedDatabase database) → Future< void> - Executed before database upgrade. Disables foreign key constraints to allow safe migration steps.
-
dropDatabase(
Migrator migrator, GeneratedDatabase database) → Future< void> - Drops all tables and recreates them. Useful for fresh migrations or during development.