commit b446015: [Minor] Clickhouse: Allow comments in extra columns

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Feb 17 14:42:09 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-02-17 14:41:09 +0000
URL: https://github.com/rspamd/rspamd/commit/b44601565c32946fce07d2ae30eaca6175482a0e (HEAD -> master)

[Minor] Clickhouse: Allow comments in extra columns

---
 src/plugins/lua/clickhouse.lua | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index a5067d014..9af6c50aa 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -1146,6 +1146,10 @@ local function add_extra_columns(upstream, ev_base, cfg)
       end
       local sql = string.format('ALTER TABLE rspamd ADD COLUMN IF NOT EXISTS `%s` %s AFTER `%s`',
           col.name, col.type, prev_column)
+      if col.comment then
+        sql = sql .. string.format(", COMMENT COLUMN `%s` '%s'", col.name, col.comment)
+      end
+
       local ret = lua_clickhouse.generic(upstream, settings, ch_params, sql,
           function(_, _)
             rspamd_logger.infox(rspamd_config,


More information about the Commits mailing list