enumTypeToSQLType method
MapEntry<String, List<String> > ?
enumTypeToSQLType(
- Type type,
- String column, {
- List<
EntityField> ? entityFieldAnnotations,
override
Returns: ENUM: valuesNames
Implementation
@override
MapEntry<String, List<String>>? enumTypeToSQLType(Type type, String column,
{List<EntityField>? entityFieldAnnotations}) {
var enumType = super.enumTypeToSQLType(type, column,
entityFieldAnnotations: entityFieldAnnotations);
if (enumType == null) return null;
var values = enumType.value;
if (values.isEmpty) {
return MapEntry('VARCHAR', values);
}
return MapEntry('VARCHAR CHECK', values);
}