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.named(
    'm_20251130100953_create_users',
    const CreateUsersTable(),
  ),
  MigrationEntry.named(
    'm_20251130101500_add_index',
    const AddEmailIndex(),
  ),
];

// Convert to descriptors (sorted by timestamp)
final descriptors = MigrationEntry.buildDescriptors(entries);

Constructors

MigrationEntry({required MigrationId id, required Migration migration})
const
MigrationEntry.named(String id, Migration migration)
Convenience constructor for manual registry entries.
factory

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.