foreignUuid method
ColumnBuilder
foreignUuid(
- String name, {
- ColumnMutation mutation = ColumnMutation.add,
- bool nullable = false,
- String? constrainedTable,
- String referencedColumn = 'id',
- ReferenceAction onDelete = ReferenceAction.noAction,
- ReferenceAction onUpdate = ReferenceAction.noAction,
Implementation
ColumnBuilder foreignUuid(
String name, {
ColumnMutation mutation = ColumnMutation.add,
bool nullable = false,
String? constrainedTable,
String referencedColumn = 'id',
ReferenceAction onDelete = ReferenceAction.noAction,
ReferenceAction onUpdate = ReferenceAction.noAction,
}) {
final builder = uuid(name, mutation: mutation);
if (nullable) {
builder.nullable();
}
if (constrainedTable != null) {
foreign(
[name],
references: constrainedTable,
referencedColumns: [referencedColumn],
onDelete: onDelete,
onUpdate: onUpdate,
);
}
return builder;
}