Files
hope-food-pantry-app/migrations/004_shared_signup_email.sql
blake f1a46e2ba7 feat: add volunteer shift signup app
Initial source, tests, migrations, and local Docker setup for the Hope Food Pantry volunteer scheduler.
2026-10-16 09:33:39 -05:00

8 lines
402 B
SQL

-- A shared inbox can sign up more than one person on the same shift.
-- The same person, matched by name without regard to case, still takes only one spot.
DROP INDEX signups_one_confirmed_email_per_shift;
CREATE UNIQUE INDEX signups_one_confirmed_person_per_shift
ON signups (shift_id, email_norm, name COLLATE NOCASE)
WHERE status = 'confirmed' AND email_norm IS NOT NULL AND name IS NOT NULL;