Skip to content

Commit

Permalink
Remove ON CONFLICT
Browse files Browse the repository at this point in the history
New user doesn't have existing settings and there's no UNIQUE constraint.
  • Loading branch information
ehuelsmann committed Dec 26, 2024
1 parent 9e9ac10 commit 6290583
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/LedgerSMB/Entity/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@ sub create {
args => [ $self->username, $role ]);
}
$prefs //= {};
my $query = q|insert into user_preference (user_id, name, value)
values ($1, $2, $3)
on conflict (user_id, name) do update set value = $3|;
my $query = <<~'SQL';
insert into
user_preference (user_id, name, value)
values ($1, $2, $3)
SQL
my $sth = $self->dbh->prepare($query)
or die $self->dbh->errstr;
for my $pref (keys $prefs->%*) {
Expand Down

0 comments on commit 6290583

Please sign in to comment.