check_xdata_xbackend/sql/create_event.sql
2021-09-22 18:03:33 +08:00

66 lines
2.2 KiB
SQL

drop table if exists debug.event;
create table debug.event
(
`#ip` Nullable(IPv4),
`#country` Nullable(String),
`#province` Nullable(String),
`#city` Nullable(String),
`#os` Nullable(String),
`#device_id` Nullable(String),
`#screen_height` Nullable(UInt16),
`#screen_width` Nullable(UInt16),
`#device_model` Nullable(String),
`#app_version` Nullable(String),
`#bundle_id` Nullable(String),
app_name Nullable(String),
game_version Nullable(String),
`#os_version` Nullable(String),
`#network_type` Nullable(String),
`#carrier` Nullable(String),
`#manufacturer` Nullable(String),
`#app_id` Nullable(String),
`#account_id` String,
`#distinct_id` Nullable(String),
binduid Nullable(String),
channel Nullable(String),
owner_name String default '',
role_name Nullable(String),
exp Nullable(UInt64),
zhanli Nullable(UInt64),
maxmapid Nullable(UInt16),
mapid Nullable(UInt16),
ghid Nullable(String),
rmbmoney Nullable(UInt64),
jinbi Nullable(UInt64),
svrindex Nullable(String),
lv Nullable(UInt16),
vip Nullable(UInt16),
game Nullable(String),
`#zone_offset` Int8 default 8,
`#event_time` DateTime('UTC'),
`#event_name` String,
`#server_time` DateTime('UTC') default now(),
----- pay ʼþ
unitPrice Nullable(UInt32),
money Nullable(String),
islishishouci Nullable(UInt8),
isdangrishouci Nullable(UInt8),
is_today_reg Nullable(UInt8),
orderid Nullable(String),
proid Nullable(String),
--- guide
step_id Nullable(UInt16),
step_group Nullable(UInt16),
guide_start_time Nullable(UInt32),
--- ping
online_ts Nullable(UInt16)
) engine = ReplacingMergeTree PARTITION BY toYYYYMMDD(`#event_time`)
ORDER BY (`owner_name`,`#event_name`, `#event_time`, `#account_id`)
SETTINGS index_granularity = 8192;