diff --git a/go-backend/internal/handlers/admin_handler.go b/go-backend/internal/handlers/admin_handler.go index fe3c6d0..810d244 100644 --- a/go-backend/internal/handlers/admin_handler.go +++ b/go-backend/internal/handlers/admin_handler.go @@ -4443,12 +4443,13 @@ func (h *AdminHandler) AdminListWaitlist(c *gin.Context) { var entries []gin.H for rows.Next() { - var id, email string + var id any // int or uuid depending on schema + var email string var name, referralCode, invitedBy, wlStatus, notes *string var createdAt, updatedAt time.Time if err := rows.Scan(&id, &email, &name, &referralCode, &invitedBy, &wlStatus, ¬es, &createdAt, &updatedAt); err == nil { entries = append(entries, gin.H{ - "id": id, "email": email, "name": name, + "id": fmt.Sprintf("%v", id), "email": email, "name": name, "referral_code": referralCode, "invited_by": invitedBy, "status": wlStatus, "notes": notes, "created_at": createdAt, "updated_at": updatedAt, diff --git a/go-backend/migrations/20260218_waitlist_alter.sql b/go-backend/migrations/20260218_waitlist_alter.sql new file mode 100644 index 0000000..769cd2f --- /dev/null +++ b/go-backend/migrations/20260218_waitlist_alter.sql @@ -0,0 +1,12 @@ +-- Alter existing waitlist table to add missing columns + +ALTER TABLE waitlist + ADD COLUMN IF NOT EXISTS referral_code text, + ADD COLUMN IF NOT EXISTS invited_by text, + ADD COLUMN IF NOT EXISTS status text NOT NULL DEFAULT 'pending', + ADD COLUMN IF NOT EXISTS notes text, + ADD COLUMN IF NOT EXISTS name text, + ADD COLUMN IF NOT EXISTS updated_at timestamptz NOT NULL DEFAULT now(); + +CREATE INDEX IF NOT EXISTS idx_waitlist_status ON waitlist(status); +CREATE INDEX IF NOT EXISTS idx_waitlist_created ON waitlist(created_at DESC);