From: Vsevolod Stakhov Date: Mon, 17 Feb 2020 14:41:09 +0000 (+0000) Subject: [Minor] Clickhouse: Allow comments in extra columns X-Git-Tag: 2.4~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b44601565c32946fce07d2ae30eaca6175482a0e;p=rspamd.git [Minor] Clickhouse: Allow comments in extra columns --- 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,