File size: 502 Bytes
d9494a5
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CREATE TABLE IF NOT EXISTS objectEvent
(
    `event`            LowCardinality(String) NOT NULL,
    `timestamp`        DateTime64(3) NOT NULL,
    `userId`           String DEFAULT '',
    `workspaceId`      String NOT NULL,
    `recordId`         String NOT NULL,
    `objectMetadataId` String NOT NULL,
    `properties`       JSON,
    `isCustom`         Boolean DEFAULT FALSE
)
    ENGINE = MergeTree
    ORDER BY (workspaceId, timestamp, event, userId)
    TTL timestamp + INTERVAL 3 YEAR DELETE;