-- Drop any unique constraint on votes that may have been created by an old migration.
-- The current schema has no unique on Vote; only PK and non-unique indexes.
DO $$
DECLARE
  r RECORD;
BEGIN
  FOR r IN
    SELECT c.conname
    FROM pg_constraint c
    WHERE c.conrelid = 'public.votes'::regclass
      AND c.contype = 'u'
  LOOP
    EXECUTE format('ALTER TABLE votes DROP CONSTRAINT IF EXISTS %I', r.conname);
  END LOOP;
END $$;
