From 62905830abf3a7b19763fd553a559bf1d96fbd05 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Thu, 26 Dec 2024 08:38:43 +0100 Subject: [PATCH] Remove ON CONFLICT New user doesn't have existing settings and there's no UNIQUE constraint. --- lib/LedgerSMB/Entity/User.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/LedgerSMB/Entity/User.pm b/lib/LedgerSMB/Entity/User.pm index 05704a1852..3790933304 100644 --- a/lib/LedgerSMB/Entity/User.pm +++ b/lib/LedgerSMB/Entity/User.pm @@ -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->%*) {