From 1d0c1d8c05cb58d4ead517a1f41cb19d84dbe02f Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Wed, 18 Feb 2026 06:00:29 +0000 Subject: [PATCH] appview/db: allow regenerating invite codes users sometimes want to regenerate invite codes, but signups_inflight never replaces the old value, since the email column has a unique constraint. by using `or replace`, we can update the invite code. this keeps the db in sync with whatever the user sees in their inbox. Signed-off-by: oppiliappan --- appview/db/signup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appview/db/signup.go b/appview/db/signup.go index fb9b4753..af949fb6 100644 --- a/appview/db/signup.go +++ b/appview/db/signup.go @@ -5,7 +5,7 @@ import ( ) func AddInflightSignup(e Execer, signup models.InflightSignup) error { - query := `insert into signups_inflight (email, invite_code) values (?, ?)` + query := `insert or replace into signups_inflight (email, invite_code) values (?, ?)` _, err := e.Exec(query, signup.Email, signup.InviteCode) return err } -- 2.51.2