Skip to content

Commit

Permalink
[Minor] Clickhouse: Allow comments in extra columns
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Feb 17, 2020
1 parent e18234e commit b446015
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/lua/clickhouse.lua
Expand Up @@ -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,
Expand Down

0 comments on commit b446015

Please sign in to comment.