Optimize DB scheme for smartlists


We have improved the product performance when using lists and smartlists. Nothing is changed from the user perspective.

  • Internally now every criterion is a separate entity like criteria in API2.  
  • There's one small breaking change in API2: if the criterion was stored as an exact date, it's From and To values in API2 now are the same and doesn't differ by 1 day, like it was before.
  • Also there are possible non-breaking changes in API1 and API2 — now it could be possible to use more criteria types or the additional ones could be easily added on request.