MigrationEntry class
Ties a MigrationId to a Migration instance.
Used to register migrations with their IDs for proper ordering. The CLI generates these automatically in migrations.dart file.
Example:
final entries = [
MigrationEntry(
id: MigrationId.parse('m_20251130100953_create_users'),
migration: const CreateUsersTable(),
),
MigrationEntry(
id: MigrationId.parse('m_20251130101500_add_index'),
migration: const AddEmailIndex(),
),
];
// Convert to descriptors (sorted by timestamp)
final descriptors = MigrationEntry.buildDescriptors(entries);
Constructors
- MigrationEntry({required MigrationId id, required Migration migration})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → MigrationId
-
final
- migration → Migration
-
final
- 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
-
buildDescriptors(
List< MigrationEntry> entries) → List<MigrationDescriptor> - Convert a list of entries to migration descriptors.