clickhouse-migrations
仓库创建 2020年1月24日最近提交 3 小时前SkillHot 收录 3 小时前
▸ 精选理由
覆盖常见陷阱与集群部署考虑,对数据库工程师非常实用。
▸ 风险提示
迁移可能影响数据与集群性能,执行前需做好备份与回滚方案。
这个 Skill 做什么
关于在仓库中创建或修改 ClickHouse 迁移的模式与约定说明。
为在仓库里新增或修改 ClickHouse 迁移提供约定和范式,说明目录结构、操作顺序和集群/分片等注意点。需要写 migration、改表或处理复制/sharded 场景时用它。特点是有示例代码、部署角色(node_roles)、sharded/replicated 等实践建议,能帮你避免常见部署失误。
▸ 展开 SKILL.md 英文原文
ClickHouse migration patterns and rules. Use when creating or modifying ClickHouse migrations.
3.7w
Stars
3.1k
Forks
40
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/PostHog/posthog/master/.agents/skills/clickhouse-migrations/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/PostHog/posthog/master/.agents/skills/clickhouse-migrations/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# ClickHouse Migrations
Read `posthog/clickhouse/migrations/AGENTS.md` for comprehensive patterns, cluster setup, examples, and ingestion layer details.
## Quick reference
### Migration structure
```python
operations = [
run_sql_with_exceptions(
SQL_FUNCTION(),
node_roles=[...],
sharded=False, # True for sharded tables
is_alter_on_replicated_table=False # True for ALTER on replicated tables
),
]
```
### Node roles (choose based on table type)
- `[NodeRole.DATA]`: Sharded tables (data nodes only)
- `[NodeRole.DATA, NodeRole.COORDINATOR]`: Non-sharded data tables, distributed read tables, replicated tables, views, dictionaries
- `[NodeRole.INGESTvia SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有