From 3a20033cc71d65f1d8b9974b405a15fdef86564f Mon Sep 17 00:00:00 2001 From: hubert Date: Wed, 13 Oct 2021 06:53:49 +0000 Subject: [PATCH] db_postgres: handle both constraints on network updates Closes: https://todo.sr.ht/~emersion/soju/138 git-svn-id: file:///srv/svn/repo/suika/trunk@634 f0ae65fe-ee39-954e-97ec-027ff2717ef4 --- db_postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_postgres.go b/db_postgres.go index aafbd95..0e7ab35 100644 --- a/db_postgres.go +++ b/db_postgres.go @@ -284,7 +284,7 @@ func (db *PostgresDB) StoreNetwork(userID int64, network *Network) error { sasl_mechanism, sasl_plain_username, sasl_plain_password, sasl_external_cert, sasl_external_key, enabled) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) - ON CONFLICT ("user", name) + ON CONFLICT DO UPDATE SET name = $2, addr = $3, nick = $4, username = $5, realname = $6, pass = $7, connect_commands = $8, sasl_mechanism = $9, sasl_plain_username = $10, sasl_plain_password = $11, sasl_external_cert = $12, sasl_external_key = $13,