2026-03-24 11:01:40 +00:00
|
|
|
-- Migration: 000025_message_channel
|
2026-03-24 11:50:13 +00:00
|
|
|
-- Description: Add channel column to messages and knowledge to track the source channel (web, api, im, etc.)
|
|
|
|
|
DO $$ BEGIN RAISE NOTICE '[Migration 000025] Adding channel column to messages and knowledge'; END $$;
|
2026-03-24 11:01:40 +00:00
|
|
|
|
|
|
|
|
ALTER TABLE messages ADD COLUMN IF NOT EXISTS channel VARCHAR(50) NOT NULL DEFAULT '';
|
|
|
|
|
COMMENT ON COLUMN messages.channel IS 'Source channel of the message: web, api, im, etc.';
|
|
|
|
|
|
2026-03-24 11:50:13 +00:00
|
|
|
ALTER TABLE knowledges ADD COLUMN IF NOT EXISTS channel VARCHAR(50) NOT NULL DEFAULT 'web';
|
|
|
|
|
COMMENT ON COLUMN knowledges.channel IS 'Source channel of the knowledge: web, api, browser_extension, wechat, etc.';
|
|
|
|
|
|
|
|
|
|
DO $$ BEGIN RAISE NOTICE '[Migration 000025] channel column added to messages and knowledge successfully'; END $$;
|