image method
Detaches the relation between this UserProfile and the UserProfileImage set in image
by setting the UserProfile's foreign key imageId to null.
This removes the association between the two models without deleting the related record.
Implementation
Future<void> image(
_i1.Session session,
UserProfile userProfile, {
_i1.Transaction? transaction,
}) async {
if (userProfile.id == null) {
throw ArgumentError.notNull('userProfile.id');
}
var $userProfile = userProfile.copyWith(imageId: null);
await session.db.updateRow<UserProfile>(
$userProfile,
columns: [UserProfile.t.imageId],
transaction: transaction,
);
}