clickhouse-migrations by posthog/posthog
npx skills add https://github.com/posthog/posthog --skill clickhouse-migrations阅读 posthog/clickhouse/migrations/AGENTS.md 以获取全面的模式、集群设置、示例和摄取层详细信息。
operations = [
run_sql_with_exceptions(
SQL_FUNCTION(),
node_roles=[...],
sharded=False, # 分片表设为 True
is_alter_on_replicated_table=False # 对复制表进行 ALTER 操作时设为 True
),
]
[NodeRole.DATA]: 分片表(仅数据节点)[NodeRole.DATA, NodeRole.COORDINATOR]: 非分片数据表、分布式读取表、复制表、视图、字典[NodeRole.INGESTION_SMALL]: 可写表、Kafka 表、摄取层上的物化视图MergeTree 引擎:
AggregatingMergeTree(table, replication_scheme=ReplicationScheme.SHARDED) 用于分片表广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
ReplacingMergeTree(table, replication_scheme=ReplicationScheme.REPLICATED) 用于非分片表CollapsingMergeTree、ReplacingMergeTreeDeletedDistributed 引擎:
Distributed(data_table="sharded_events", sharding_key="sipHash64(person_id)")Distributed(data_table="my_table", cluster=settings.CLICKHOUSE_SINGLE_SHARD_CLUSTER)ON CLUSTER 子句IF EXISTS / IF NOT EXISTS 子句DROP TABLE IF EXISTS ... SYNCon_cluster 参数,始终将其设置为 on_cluster=Falsesharded=Trueis_alter_on_replicated_table=True从 infi_clickhouse_orm_migrations 表中删除条目以重新运行迁移。
每周安装数
78
代码仓库
GitHub 星标数
32.3K
首次出现
2026年2月16日
安全审计
安装于
opencode77
github-copilot77
codex77
kimi-cli77
amp77
gemini-cli77
Read posthog/clickhouse/migrations/AGENTS.md for comprehensive patterns, cluster setup, examples, and ingestion layer details.
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
),
]
[NodeRole.DATA]: Sharded tables (data nodes only)[NodeRole.DATA, NodeRole.COORDINATOR]: Non-sharded data tables, distributed read tables, replicated tables, views, dictionaries[NodeRole.INGESTION_SMALL]: Writable tables, Kafka tables, materialized views on ingestion layerMergeTree engines:
AggregatingMergeTree(table, replication_scheme=ReplicationScheme.SHARDED) for sharded tablesReplacingMergeTree(table, replication_scheme=ReplicationScheme.REPLICATED) for non-shardedCollapsingMergeTree, ReplacingMergeTreeDeletedDistributed engine:
Distributed(data_table="sharded_events", sharding_key="sipHash64(person_id)")Distributed(data_table="my_table", cluster=settings.CLICKHOUSE_SINGLE_SHARD_CLUSTER)ON CLUSTER clause in SQL statementsIF EXISTS / IF NOT EXISTS clausesDROP TABLE IF EXISTS ... SYNCon_cluster=Falsesharded=True when altering sharded tablesis_alter_on_replicated_table=True when altering non-sharded replicated tablesDelete entry from infi_clickhouse_orm_migrations table to re-run a migration.
Weekly Installs
78
Repository
GitHub Stars
32.3K
First Seen
Feb 16, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode77
github-copilot77
codex77
kimi-cli77
amp77
gemini-cli77
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
111,700 周安装
二进制初步分析指南:使用ReVa工具快速识别恶意软件与逆向工程
69 周安装
PrivateInvestigator 道德人员查找工具 | 公开数据调查、反向搜索与背景研究
69 周安装
TorchTitan:PyTorch原生分布式大语言模型预训练平台,支持4D并行与H100 GPU加速
69 周安装
screenshot 截图技能:跨平台桌面截图工具,支持macOS/Linux权限管理与多模式捕获
69 周安装
tmux进程管理最佳实践:交互式Shell初始化、会话命名与生命周期管理
69 周安装
Git Rebase Sync:安全同步分支的Git变基工具,解决冲突与备份
69 周安装