copyWith method

ColumnDefinition copyWith({
  1. ColumnType? type,
  2. bool? unsigned,
  3. bool? nullable,
  4. bool? unique,
  5. bool? indexed,
  6. bool? primaryKey,
  7. bool? autoIncrement,
  8. ColumnDefault? defaultValue,
  9. bool clearDefault = false,
  10. String? comment,
  11. String? charset,
  12. String? collation,
  13. String? afterColumn,
  14. bool? first,
  15. String? generatedAs,
  16. String? storedAs,
  17. String? virtualAs,
  18. bool? useCurrentOnUpdate,
  19. bool? invisible,
  20. bool? always,
  21. List<String>? allowedValues,
  22. Map<String, ColumnDriverOverride>? driverOverrides,
})

Implementation

ColumnDefinition copyWith({
  ColumnType? type,
  bool? unsigned,
  bool? nullable,
  bool? unique,
  bool? indexed,
  bool? primaryKey,
  bool? autoIncrement,
  ColumnDefault? defaultValue,
  bool clearDefault = false,
  String? comment,
  String? charset,
  String? collation,
  String? afterColumn,
  bool? first,
  String? generatedAs,
  String? storedAs,
  String? virtualAs,
  bool? useCurrentOnUpdate,
  bool? invisible,
  bool? always,
  List<String>? allowedValues,
  Map<String, ColumnDriverOverride>? driverOverrides,
}) {
  return ColumnDefinition(
    name: name,
    type: type ?? this.type,
    unsigned: unsigned ?? this.unsigned,
    nullable: nullable ?? this.nullable,
    unique: unique ?? this.unique,
    indexed: indexed ?? this.indexed,
    primaryKey: primaryKey ?? this.primaryKey,
    autoIncrement: autoIncrement ?? this.autoIncrement,
    defaultValue: clearDefault ? null : (defaultValue ?? this.defaultValue),
    comment: comment ?? this.comment,
    charset: charset ?? this.charset,
    collation: collation ?? this.collation,
    afterColumn: afterColumn ?? this.afterColumn,
    first: first ?? this.first,
    generatedAs: generatedAs ?? this.generatedAs,
    storedAs: storedAs ?? this.storedAs,
    virtualAs: virtualAs ?? this.virtualAs,
    useCurrentOnUpdate: useCurrentOnUpdate ?? this.useCurrentOnUpdate,
    invisible: invisible ?? this.invisible,
    always: always ?? this.always,
    allowedValues: allowedValues ?? this.allowedValues,
    driverOverrides: driverOverrides ?? this.driverOverrides,
  );
}