Initial source, tests, migrations, and local Docker setup for the Hope Food Pantry volunteer scheduler.
8 lines
402 B
SQL
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;
|