Browse Source

Fix constraint language of subscribe query

master
Peter Stuifzand 8 months ago
parent
commit
3b2e866f3e
  1. 2
      cmd/hubserver/storage/postgres.go

2
cmd/hubserver/storage/postgres.go

@ -29,7 +29,7 @@ func (s *postgres) Subscribe(topic string, sub Subscriber) error {
INSERT INTO "subscribers"
("topic", "callback", "lease_seconds", "secret", "created")
VALUES ($1, $2, $3, $4, now())
ON CONFLICT ON CONSTRAINT subscribers_topic_callback
ON CONFLICT (topic, callback)
DO UPDATE SET lease_seconds = excluded.lease_seconds,
secret = excluded.secret,
updated = excluded.created

Loading…
Cancel
Save