forGenerator property
Generated Dart code to include in a schema.
Implementation
@override
String get forGenerator {
final parts = ["'$name'", columnType];
if (autoincrement != InsertColumn.defaults.autoincrement) {
parts.add('autoincrement: $autoincrement');
}
if (defaultValue != null) {
parts.add('defaultValue: $defaultValue');
}
if (nullable != InsertColumn.defaults.nullable) {
parts.add('nullable: $nullable');
}
if (isPrimaryKey) {
parts.add('isPrimaryKey: $isPrimaryKey');
}
if (isForeignKey) {
parts.addAll([
'isForeignKey: $isForeignKey',
"foreignTableName: '$foreignTableName'",
'onDeleteCascade: $onDeleteCascade',
'onDeleteSetDefault: $onDeleteSetDefault',
]);
}
if (unique != InsertColumn.defaults.unique) {
parts.add('unique: $unique');
}
return 'SchemaColumn(${parts.join(', ')})';
}