MField constructor
MField({
- required String name,
- required FieldTypes type,
- bool isPrimaryKey = false,
- bool isAutoIncrement = false,
- bool isNullable = false,
- String defaultValue = '',
- String? comment,
- 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 [],
});