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
This commit is contained in:
hubert 2021-10-13 06:53:49 +00:00
parent dcba21c7e5
commit 3a20033cc7

View File

@ -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,