blob: 8af45443e4ce4a08ed1e2d05875a763db6f97107 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
CREATE TABLE events
(
id UInt64 DEFAULT 0,
path String DEFAULT '',
author_id UInt64 DEFAULT 0,
target_id UInt64 DEFAULT 0,
target_type LowCardinality(String) DEFAULT '',
action UInt8 DEFAULT 0,
deleted UInt8 DEFAULT 0,
created_at DateTime64(6, 'UTC') DEFAULT now(),
updated_at DateTime64(6, 'UTC') DEFAULT now()
)
ENGINE = ReplacingMergeTree(updated_at, deleted)
PRIMARY KEY (id)
ORDER BY (id)
PARTITION BY toYear(created_at)
|