When using --import-data (and possible other code paths leading to dbAddRuleFilter), the rule id this filter belongs to is stored in the rule field of the filter table:
This mismatch causes at least --import-data to fail. Simply changing the SELECT statement to match on rule = $1 instead works, but I'm unsure if this doesn't break other parts of the codebase which store the rule id in the id field of filter.
When using
--import-data
(and possible other code paths leading todbAddRuleFilter
), the rule id this filter belongs to is stored in therule
field of thefilter
table:https://github.com/JM-Lemmi/ical-relay/blob/ea4ce9485c216f6c438c3250123f4ae9541c9d26/pkg/datastore/database.go#L445-L447
However, when retrieving a rule, only filters where the
id
of the filter in the database matches therule
are returned:https://github.com/JM-Lemmi/ical-relay/blob/ea4ce9485c216f6c438c3250123f4ae9541c9d26/pkg/datastore/database.go#L205-L206
This mismatch causes at least
--import-data
to fail. Simply changing theSELECT
statement to match onrule = $1
instead works, but I'm unsure if this doesn't break other parts of the codebase which store the rule id in theid
field offilter
.