userProfile method

Future<void> userProfile(
  1. Session session,
  2. UserProfileImage userProfileImage,
  3. UserProfile userProfile, {
  4. Transaction? transaction,
})

Creates a relation between the given UserProfileImage and UserProfile by setting the UserProfileImage's foreign key userProfileId to refer to the UserProfile.

Implementation

Future<void> userProfile(
  _i1.Session session,
  UserProfileImage userProfileImage,
  _i2.UserProfile userProfile, {
  _i1.Transaction? transaction,
}) async {
  if (userProfileImage.id == null) {
    throw ArgumentError.notNull('userProfileImage.id');
  }
  if (userProfile.id == null) {
    throw ArgumentError.notNull('userProfile.id');
  }

  var $userProfileImage = userProfileImage.copyWith(
    userProfileId: userProfile.id,
  );
  await session.db.updateRow<UserProfileImage>(
    $userProfileImage,
    columns: [UserProfileImage.t.userProfileId],
    transaction: transaction,
  );
}