--- routes-filters


ALTER TABLE routes
  ADD
  channel_filter BIT,
  category_filter BIT;


UPDATE routes
SET
  channel_filter  =
  CASE
  WHEN channel_ids = ''
    THEN 0
  ELSE 1
  END,

  category_filter =
  CASE
  WHEN
    category_ids = ''
    THEN 0
  ELSE 1
  END;


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