copyWith method
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,
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,
);
}