diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-03 11:43:37 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-03 11:43:37 +0100 |
commit | 670f8af4859716e7f5dda4ea97515b583a8b7b28 (patch) | |
tree | 704aacdc7b2cecbdd15986840e43ec254e0d57cf | |
parent | 32c8c7b394d2c4dfa4a520f832a79f93f41a79b7 (diff) | |
download | rspamd-670f8af4859716e7f5dda4ea97515b583a8b7b28.tar.gz rspamd-670f8af4859716e7f5dda4ea97515b583a8b7b28.zip |
[Feature] Clickhouse: Modernise table initial schema
-rw-r--r-- | src/plugins/lua/clickhouse.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 6e427682f..af23e428e 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -92,7 +92,7 @@ CREATE TABLE rspamd From String, MimeFrom String, IP String, - Score Float64, + Score Float32, NRcpt UInt8, Size UInt32, IsWhitelist Enum8('blacklist' = 0, 'whitelist' = 1, 'unknown' = 2) DEFAULT 'unknown', @@ -133,7 +133,9 @@ CREATE TABLE rspamd SMTPRcpt ALIAS if(RcptDomain = '', '', concat(RcptUser, '@', RcptDomain)), MIMEFrom ALIAS if(MimeFrom = '', '', concat(MimeUser, '@', MimeFrom)), MIMERcpt ALIAS MimeRecipients[1] -) ENGINE = MergeTree(Date, (TS, From), 8192) +) ENGINE = MergeTree() +PARTITION BY Date +ORDER BY TS ]], [[CREATE TABLE rspamd_version ( Version UInt32) ENGINE = TinyLog]], [[INSERT INTO rspamd_version (Version) Values (${SCHEMA_VERSION})]], |