fix(TTL): tables now have a default TTL for data of 1 MONTH
This commit is contained in:
parent
4417c880b6
commit
3034ef2edd
@ -32,10 +32,18 @@ export class TimeDataTable {
|
||||
|
||||
// create table in clickhouse
|
||||
await smartClickHouseDbRefArg.clickhouseClient
|
||||
.queryPromise(`CREATE TABLE IF NOT EXISTS ${newTable.tableName} (
|
||||
timestamp DateTime64(3, 'Europe/Berlin'),
|
||||
message String
|
||||
) ENGINE=MergeTree() ORDER BY timestamp`);
|
||||
.queryPromise(`
|
||||
CREATE TABLE IF NOT EXISTS ${newTable.tableName} (
|
||||
timestamp DateTime64(3, 'Europe/Berlin'),
|
||||
message String
|
||||
) ENGINE=MergeTree() ORDER BY timestamp
|
||||
`);
|
||||
|
||||
// lets adjust the TTL
|
||||
await smartClickHouseDbRefArg.clickhouseClient
|
||||
.queryPromise(`
|
||||
ALTER TABLE ${newTable.tableName} MODIFY TTL toDateTime(timestamp) + INTERVAL 1 MONTH;
|
||||
`);
|
||||
|
||||
await newTable.updateColumns();
|
||||
console.log(`=======================`)
|
||||
|
Loading…
Reference in New Issue
Block a user