-- 并发控制配置表
CREATE TABLE IF NOT EXISTS tb_polling_concurrency_config (
    id BIGSERIAL PRIMARY KEY,
    task_type VARCHAR(50) NOT NULL UNIQUE,
    max_concurrency INT NOT NULL DEFAULT 50,
    description TEXT,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by BIGINT
);

-- 索引
CREATE INDEX idx_polling_concurrency_task_type ON tb_polling_concurrency_config(task_type);

-- 表注释
COMMENT ON TABLE tb_polling_concurrency_config IS '并发控制配置表 - 控制不同类型任务的最大并发数';

-- 列注释
COMMENT ON COLUMN tb_polling_concurrency_config.task_type IS '任务类型：realname/carddata/package/stop_start';
COMMENT ON COLUMN tb_polling_concurrency_config.max_concurrency IS '最大并发数';
COMMENT ON COLUMN tb_polling_concurrency_config.description IS '配置说明';
COMMENT ON COLUMN tb_polling_concurrency_config.created_at IS '创建时间';
COMMENT ON COLUMN tb_polling_concurrency_config.updated_at IS '更新时间';
COMMENT ON COLUMN tb_polling_concurrency_config.updated_by IS '更新人ID';
