MigrationGenerator class

Generates <Model>Migration.dart from an abstract Model class.

Constructors

MigrationGenerator({bool autoSnakeCaseNames = true})
const

Properties

autoSnakeCaseNames bool
If true (default), then field names will automatically be (de)serialized as snake_case.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
throwOnUnresolved bool
finalinherited
typeChecker → TypeChecker
no setterinherited

Methods

buildDownMigration(OrmBuildContext? ctx) → Method
Generate down() method to drop tables
buildUpMigration(OrmBuildContext ctx, LibraryBuilder lib) → Method
Generate up() method to create tables
generate(LibraryReader library, BuildStep buildStep) FutureOr<String>
Generates Dart code for an input Dart library.
inherited
generateForAnnotatedElement(Element element, ConstantReader annotation, BuildStep buildStep) Future<String?>
Implement to return source code to generate for element.
generateMigrationLibrary(OrmBuildContext ctx, ClassElement element, Resolver resolver, BuildStep buildStep) → Library
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