OrmMigrationRecord class

Available extensions
Annotations
  • @OrmModel.new(table: 'orm_migrations')

Constructors

OrmMigrationRecord({required String id, required String checksum, required DateTime appliedAt, required int batch})
const

Properties

appliedAt DateTime
final
batch int
final
checksum String
final
connection → DriverAdapter?
The driver/connection associated with this model, if any.
no setterinherited
connectionResolver → ConnectionResolver?
The resolver attached to this model, when present.
no setterinherited
definition → ModelDefinition<OrmMigrationRecord>?
Typed accessor to the attached ModelDefinition, when available. Returns null for untracked models (they don't have attached definitions).
no setterinherited
exists bool
Whether this model has been persisted (loaded or saved).
no setterinherited
hasConnection bool
Whether a resolver/connection has been attached.
no setterinherited
hasDefinition bool
Whether a ModelDefinition has been attached to this instance. Always false for untracked models.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
final
loadedRelationNames Set<String>
Returns names of all loaded relations.
no setterinherited
loadedRelations Map<String, dynamic>
Returns a snapshot of all currently loaded relations.
no setterinherited
relations Map<String, dynamic>
Shorthand alias for loadedRelations.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asMap({ValueCodecRegistry? registry}) Map<String, Object?>
Alias for toRecord for ergonomics when bridging to JSON/Maps.
inherited
associate(String relationName, Model<Model> parent) Future<OrmMigrationRecord>
Associates a belongsTo parent model and updates the foreign key.
inherited
attach(String relationName, List ids, {Map<String, dynamic>? pivotData}) Future<OrmMigrationRecord>
Attaches related models in a manyToMany relationship.
inherited
attachConnection(DriverAdapter driver) → void
Legacy helper for manually attaching a driver outside a resolver.
inherited
attachConnectionResolver(ConnectionResolver resolver) → void
Assigns the resolver responsible for this model instance.
inherited
clearQueuedJsonMutations() → void
Clears any queued JSON mutations without persisting them.
inherited
clearRelations() → void
Clears all cached relations.
inherited
delete({bool force = false}) Future<void>
Deletes the record. Soft-deletes when supported unless force is true.
inherited
describeMutation(MutationPlan plan) → StatementPreview
Returns the statement preview for a write plan.
inherited
describeQuery(QueryPlan plan) → StatementPreview
Returns the statement preview for a read plan.
inherited
detach(String relationName, [List? ids]) Future<OrmMigrationRecord>
Detaches related models in a manyToMany relationship.
inherited
dissociate(String relationName) Future<OrmMigrationRecord>
Dissociates a belongsTo parent model and clears the foreign key.
inherited
expectDefinition() → ModelDefinition<OrmMigrationRecord>
Ensures the definition metadata is available, throwing when missing.
inherited
fill(Map<String, Object?> attributes, {bool strict = false, ValueCodecRegistry? registry}) → Model<OrmMigrationRecord>
Mass assigns attributes, honoring fillable/guarded metadata.
inherited
fillIfAbsent(Map<String, Object?> attributes, {bool strict = false, ValueCodecRegistry? registry}) → Model<OrmMigrationRecord>
Mass assigns only values that are currently absent.
inherited
forceDelete() Future<void>
Hard-deletes the record, bypassing soft-delete flows entirely.
inherited
forceFill(Map<String, Object?> attributes, {ValueCodecRegistry? registry}) → Model<OrmMigrationRecord>
Temporarily disables mass-assignment protection while callback runs.
inherited
fresh({bool withTrashed = false, Iterable<String>? withRelations}) Future<OrmMigrationRecord>
Returns a fresh instance of this model from the database.
inherited
getRelation<T>(String name) → T?
Retrieves a cached relation value typed as T.
inherited
getRelationList<T>(String name) List<T>
Retrieves a list relation typed as T.
inherited
isDifferentFrom(Model<Model>? other) bool
Determine if two models are different.
inherited
isSameAs(Model<Model>? other) bool
Determine if two models represent the same database record.
inherited
jsonPatch(String column, Map<String, Object?> delta) → void
Queues a JSON patch merge for column using the provided delta map.
inherited
jsonSet(String selector, Object? value) → void
Queues a JSON update using Laravel-style selector syntax (column->path). Call save to persist the change.
inherited
jsonSetPath(String column, String path, Object? value) → void
Queues a JSON update by explicitly providing path relative to column.
inherited
load(String relation, [PredicateCallback<OrmEntity>? constraint]) Future<OrmMigrationRecord>
Lazily loads a relation on this model instance.
inherited
loadAvg(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the average of a column in a relation.
inherited
loadCount(String relation, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the count of a relation.
inherited
loadExists(String relation, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the existence of a relation.
inherited
loadMany(Map<String, PredicateCallback<OrmEntity>?> relations) Future<OrmMigrationRecord>
Lazily loads multiple relations with optional constraints.
inherited
loadMax(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the maximum value of a column in a relation.
inherited
loadMin(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the minimum value of a column in a relation.
inherited
loadMissing(Iterable<String> relations) Future<OrmMigrationRecord>
Lazily loads multiple relations that haven't been loaded yet.
inherited
loadSum(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the sum of a column in a relation.
inherited
markAsExisting() → void
Marks this model as existing in the database.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh({bool withTrashed = false, Iterable<String>? withRelations}) Future<OrmMigrationRecord>
Reloads the latest row from the database, optionally including trashed.
inherited
relationLoaded(String name) bool
Checks if a relation has been loaded.
inherited
replicate({List<String>? except}) OrmMigrationRecord
Clone the model into a new, non-existing instance.
inherited
restore() Future<void>
Restores a soft-deleted record.
inherited
runMutation(MutationPlan plan) Future<MutationResult>
Runs a write plan through the attached resolver.
inherited
runSelect(QueryPlan plan) Future<List<Map<String, Object?>>>
Runs a read plan through the attached resolver.
inherited
save({bool returning = true}) Future<OrmMigrationRecord>
Persists the model using the active resolver and returns the stored copy.
inherited
setRelation(String name, dynamic value) → void
Sets a relation value and marks it as loaded.
inherited
setRelations(Map<String, dynamic> relations) → void
Bulk sets multiple relations at once.
inherited
sync(String relationName, List ids, {Map<String, dynamic>? pivotData}) Future<OrmMigrationRecord>
Syncs a manyToMany relationship to match the given IDs exactly.
inherited
syncRelationsFromQueryRow(Map<String, dynamic> rowRelations) → void
Syncs relations from a QueryRow into this model's cache.
inherited
toArray({ValueCodecRegistry? registry, bool includeHidden = false}) Map<String, Object?>
Converts the model into a metadata-aware map, honoring hidden/visible lists.
inherited
toJson({ValueCodecRegistry? registry, bool includeHidden = false}) String
Converts the model instance into JSON, applying the attribute metadata.
inherited
toRecord({ValueCodecRegistry? registry}) Map<String, Object?>
Serializes the model into a column map via its codec/definition.
inherited
toString() String
A string representation of this object.
inherited
toTracked() $OrmMigrationRecord

Available on OrmMigrationRecord, provided by the OrmMigrationRecordOrmExtension extension

Converts this immutable model to a tracked ORM-managed model. The tracked model supports attribute tracking, change detection, and persistence operations like save() and touch().
unsetRelation(String name) → void
Removes a relation from the cache and marks it as not loaded.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited