# база данных: monitor
# когда нужно выполнить: до выкладки
# примерное время выполнения: 32 секунды на devtest, можно выполнять "по-живому"

create table adv_sessions (
       vid bigint unsigned not null,
       stat_date date not null,
       sessions_cnt smallint unsigned not null,
       sessions_start timestamp not null default '0000-00-00 00:00:00',
       sessions_end timestamp not null default '0000-00-00 00:00:00',
       primary key (vid, stat_date),
       unique key (stat_date, vid)
);

alter table adv_actions
      add column first_camp_sessions smallint unsigned not null,
      add column first_pay_sessions smallint unsigned not null;

