twenty / packages /twenty-server /src /database /clickHouse /migrations /002-create-pageview-table.sql
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
349 Bytes
CREATE TABLE IF NOT EXISTS pageview
(
`name` LowCardinality(String) NOT NULL,
`timestamp` DateTime64(3) NOT NULL,
`userId` String DEFAULT '',
`workspaceId` String DEFAULT '',
`properties` JSON
)
ENGINE = MergeTree
ORDER BY (workspaceId, timestamp, name, userId)
TTL timestamp + INTERVAL 3 YEAR DELETE;