MField constructor

MField({
  1. required String name,
  2. required FieldTypes type,
  3. bool isPrimaryKey = false,
  4. bool isAutoIncrement = false,
  5. bool isNullable = false,
  6. String defaultValue = '',
  7. String? comment,
  8. List<ValidatorEvent> validators = const [],
})

Creates a new MySQL field definition.

name is the field name (required) type is the MySQL data type (required) isPrimaryKey indicates if this is a primary key field (default: false) isAutoIncrement enables auto-increment for the field (default: false) isNullable allows NULL values for the field (default: false) defaultValue sets a default value for the field (default: empty string) comment adds a comment to the field definition (optional)

Implementation

MField({
  required this.name,
  required this.type,
  this.isPrimaryKey = false,
  this.isAutoIncrement = false,
  this.isNullable = false,
  this.defaultValue = '',
  this.comment,
  this.validators = const [],
});