MigrationFile class
Write a Dart migration into db/migration, with the same file name
as dox make:migration: 2026_10_21_120000_create_queue_tables.dart.
Use it in a package command that adds a migration, like queue:table.
dox migrate then writes db/migration/migrations.dart again (and
makes bin/migrate.dart when it is missing), so the new file runs.
Keep the name rules the same as createMigration and
nextMigrationTime in dox-cli (lib/src/tools/create_migration.dart).
dox-cli can not use dox_core yet, so the rules are in both places.
Constructors
- MigrationFile({Directory? folder})
-
folderisdb/migrationof the current folder by default.
Properties
Methods
-
create(
String name, String source) → String? -
write
sourceas a new migration namedname(snake case, likecreate_queue_tables) and return its path. Return null and write nothing when a migration with this name is already in the folder, so a second run does not add the tables twice. -
exists(
String name) → bool -
true when a migration named
nameis in the folder, at any time -
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