hcb icon indicating copy to clipboard operation
hcb copied to clipboard

[Event::Configuration] Add unique index on `event_id`

Open garyhtou opened this issue 4 months ago • 2 comments

We don't want multiple Event::Configurations per Event. So, let's add a unique index on event_configurations.event_id. A Rails validation would also be nice

class Event::Configuration
  validates :event, uniqueness: true
end

https://hcb.hackclub.com/blazer/queries/998-duplicate-event-configuration

garyhtou avatar Oct 28 '25 23:10 garyhtou

Before merging a PR, we need to fix the production data and merge duplicate configurations

garyhtou avatar Oct 28 '25 23:10 garyhtou

Should we make a one time job that deletes the less recently updated config of all these events?

Luke-Oldenburg avatar Nov 02 '25 21:11 Luke-Oldenburg