· 8 years ago · Feb 01, 2018, 09:24 AM
1create table if not exists `creative_teaser_visit` (
2 `id` bigint(20) UNSIGNED not null AUTO_INCREMENT,
3 `visit_day` datetime not null default '1000-01-01 00:00:00',
4 `creative_id` int(11) not null default 0,
5 `pre_landing_id` int(11) not null default 0,
6 `landing_id` int(11) not null default 0,
7 `sait_id` int(11) not null default 0,
8 `link_id` int(11) not null default 0,
9 `link_split_id` int(11) not null default 0,
10 `device_type` tinyint(2) COMMENT 'Тип трафика, 1 - мобильный, 2 - деÑктоп' not null default 2,
11 `country` varchar(3) collate utf8_unicode_ci default '',
12 `visit_counter` int(11) not null default 0,
13 `clicks_counter` int(11) not null default 0,
14 `postback_waiting` int(11) UNSIGNED not null default 0,
15 `postback_declined` int(11) UNSIGNED not null default 0,
16 `postback_approved` int(11) UNSIGNED not null default 0,
17 `postback_amount` int(11) UNSIGNED not null default 0,
18 PRIMARY KEY (
19 `id`,
20 `visit_day`
21 )
22 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
23 PARTITION BY RANGE(visit_day)(
24 PARTITION p1 VALUES LESS THAN '2018-01-01 00:00:00',
25 PARTITION p2 VALUES LESS THAN '2018-04-01 00:00:00',
26 PARTITION p3 VALUES LESS THAN '2018-07-01 00:00:00',
27 PARTITION p4 VALUES LESS THAN '2018-10-01 00:00:00',
28 PARTITION p5 VALUES LESS THAN '2019-01-01 00:00:00',
29 PARTITION p6 VALUES LESS THAN '2019-04-01 00:00:00',
30 PARTITION p7 VALUES LESS THAN '2019-07-01 00:00:00',
31 PARTITION p8 VALUES LESS THAN '2019-10-01 00:00:00',
32 PARTITION p9 VALUES LESS THAN '2020-01-01 00:00:00',
33 PARTITION p10 VALUES LESS THAN '2020-04-01 00:00:00',
34 PARTITION p11 VALUES LESS THAN '2020-07-01 00:00:00',
35 PARTITION p12 VALUES LESS THAN '2020-10-01 00:00:00'
36 )