--- routes-filters


ALTER TABLE routes
  ADD channel_filter BOOLEAN,
  ADD category_filter BOOLEAN;


UPDATE routes
SET
  channel_filter  =
  CASE
  WHEN channel_ids = ''
    THEN FALSE
  ELSE TRUE
  END,

  category_filter =
  CASE
  WHEN
    category_ids = ''
    THEN FALSE
  ELSE TRUE
  END;


ALTER TABLE routes
  ALTER COLUMN channel_filter SET NOT NULL;
ALTER TABLE routes
  ALTER COLUMN category_filter SET NOT NULL;
