Agent skill

Clickhouse Cloud Multi Table Rename

by divinevideo in divinevideo/divine-mobile

Fix ClickHouse Cloud migration failures caused by multi-table RENAME statements.

MPL-2.0Auto-check passedDatabases

Install Clickhouse Cloud Multi Table Rename

skills CLI
$ npx skills add divinevideo/divine-mobile --skill clickhouse-cloud-multi-table-rename -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install divinevideo/divine-mobile clickhouse-cloud-multi-table-rename --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/clickhouse-cloud-multi-table-rename .claude/skills/clickhouse-cloud-multi-table-rename && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clickhouse-cloud-multi-table-rename
GitHub stars
266
Token cost
~1.4k tokens
SKILL.md length
364 words
Files
1
Skills in repo
103
Repo updated
First seen
Licence
MPL-2.0

At a glance

Fix ClickHouse Cloud migration failures caused by multi-table RENAME statements.

  • Works in 4 steps: Check the current state — identify which… → Complete the migration manually with… → Force the migration version to mark it… → …
  • Migration fails with Database X is Shared
  • SKILL.md covers Problem, Context / Trigger Conditions, Solution and Verification, plus 3 more sections
  • Calls curl

What it does

Clickhouse Cloud Multi Table Rename is an agent skill from divinevideo/divine-mobile. Fix ClickHouse Cloud migration failures caused by multi-table RENAME statements. Use when: (1) Migration fails with "Database X is Shared, it does not support renaming of multiple tables in single query", (2) golang-migrate or other migration tools show dirty database version after a table-swap migration on ClickHouse Cloud, (3) Schema migration works on self-hosted ClickHouse but fails on ClickHouse Cloud. ClickHouse Cloud uses SharedMergeTree engine which has restrictions not present in regular MergeTree.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering Data warehousing. It works with ClickHouse and Go. The licence is MPL-2.0.

When your agent uses it

  • Migration fails with Database X is Shared
  • It does not support renaming of multiple tables in single query
  • Other migration tools show dirty database version after a table-swap migration on ClickHouse Cloud
  • Schema migration works on self-hosted ClickHouse but fails on ClickHouse Cloud

Example prompts

  • “/clickhouse-cloud-multi-table-rename”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Check the current state — identify which tables exist and what state they're in
  2. Complete the migration manually with separate renames
  3. Force the migration version to mark it as completed
  4. If using K8s jobs, recreate the job with force VERSION args

What it can do on your machine

Read from SKILL.md and the folder at commit 6487b05. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Clickhouse Cloud Multi Table Rename loads about 1.4k tokens when it runs. Until then it costs about 137 tokens; SKILL.md has 364 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~137
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from divinevideo/divine-mobile at commit 6487b05, republished under its MPL-2.0 licence (© divinevideo). 364 words, ~1,352 tokens.

Download SKILL.mdSave it as .claude/skills/clickhouse-cloud-multi-table-rename/SKILL.md (or your agent's skills folder).
name
clickhouse-cloud-multi-table-rename
description
Fix ClickHouse Cloud migration failures caused by multi-table RENAME statements. Use when: (1) Migration fails with "Database X is Shared, it does not support renaming of multiple tables in single query", (2) golang-migrate or other migration tools show dirty database version after a table-swap migration on ClickHouse Cloud, (3) Schema migration works on self-hosted ClickHouse but fails on ClickHouse Cloud. ClickHouse Cloud uses SharedMergeTree engine which has restrictions not present in regular MergeTree.
author
Claude Code
version
1.0.0
date
2026-02-22

ClickHouse Cloud Multi-Table RENAME Limitation

Problem

ClickHouse Cloud (SharedMergeTree engine) does not support renaming multiple tables in a single RENAME TABLE statement, which is a common pattern for atomic table swaps in schema migrations. Self-hosted ClickHouse supports this, so migrations that work locally or on self-hosted instances will fail on ClickHouse Cloud.

Context / Trigger Conditions

  • Error message: "Database X is Shared, it does not support renaming of multiple tables in single query"
  • Error code: 48
  • Using golang-migrate (or similar) with ClickHouse Cloud
  • Migration SQL contains a pattern like:
    sql
    RENAME TABLE db.original TO db.original_old,
                 db.new_version TO db.original;
  • Migration works in staging (self-hosted ClickHouse) but fails in production (ClickHouse Cloud)

Solution

Prevention: Write ClickHouse Cloud-compatible migrations

Instead of multi-table RENAME:

sql
-- BAD: This fails on ClickHouse Cloud
RENAME TABLE nostr.my_table TO nostr.my_table_old,
             nostr.my_table_v2 TO nostr.my_table;

Use separate RENAME statements:

sql
-- GOOD: Split into individual operations
RENAME TABLE nostr.my_table TO nostr.my_table_old;
RENAME TABLE nostr.my_table_v2 TO nostr.my_table;

Note: This loses atomicity, but ClickHouse Cloud doesn't support the atomic version anyway.

Recovery: Fix a dirty migration that already failed
  1. Check the current state — identify which tables exist and what state they're in:

    sql
    SHOW TABLES LIKE '%my_table%';
    DESCRIBE TABLE nostr.my_table;       -- Check if it has old or new schema
    DESCRIBE TABLE nostr.my_table_v2;    -- Check if the new table was created
  2. Complete the migration manually with separate renames:

    sql
    -- If both original and v2 exist (RENAME never executed):
    RENAME TABLE nostr.my_table TO nostr.my_table_old;
    RENAME TABLE nostr.my_table_v2 TO nostr.my_table;
    DROP TABLE IF EXISTS nostr.my_table_old;
    -- Recreate any views that were dropped
  3. Force the migration version to mark it as completed:

    bash
    # Using golang-migrate
    migrate -path=/migrations -database "clickhouse://..." force VERSION
  4. If using K8s jobs, recreate the job with force VERSION args:

    yaml
    containers:
      - name: migrate
        image: my-migrate-image:tag
        args: ["force", "65"]  # The migration number that was applied manually

Verification

After manual migration, verify:

sql
-- Check table has new schema
DESCRIBE TABLE nostr.my_table;

-- Check migration version is clean (not dirty)
SELECT version, dirty FROM schema_migrations ORDER BY version DESC LIMIT 5;

-- Check old/temp tables are cleaned up
SHOW TABLES LIKE '%my_table%';
Show full SKILL.md (180 more words)Show less

Example

Migration 65 for funnelcake needed to change view_traffic_sources.source from Enum8 to String. The migration:

  1. Dropped a dependent view
  2. Created view_traffic_sources_v2 with new schema
  3. Copied data
  4. Tried RENAME TABLE original TO old, v2 TO original — FAILED on ClickHouse Cloud

Recovery:

bash
# Via HTTP API from a curl pod in the cluster:
curl -s "$CH_URL/?database=nostr&user=$USER&password=$PASS" \
  --data-binary 'RENAME TABLE nostr.view_traffic_sources TO nostr.view_traffic_sources_old'
curl -s "$CH_URL/?database=nostr&user=$USER&password=$PASS" \
  --data-binary 'RENAME TABLE nostr.view_traffic_sources_v2 TO nostr.view_traffic_sources'
curl -s "$CH_URL/?database=nostr&user=$USER&password=$PASS" \
  --data-binary 'DROP TABLE IF EXISTS nostr.view_traffic_sources_old'
# Recreate the summary view...
# Then force migration version to 65

Notes

  • SharedMergeTree is the default engine on ClickHouse Cloud — you cannot switch to regular MergeTree
  • Other SharedMergeTree limitations exist (e.g., some ALTER operations behave differently)
  • When writing migrations for dual self-hosted/cloud environments, always use separate RENAME statements
  • The golang-migrate ClickHouse driver uses x-multi-statement=true which splits statements on ;, but the RENAME with commas is still a single statement
  • If a failed migration left a _v2 table behind, you must DROP TABLE IF EXISTS it before re-running the migration, or CREATE TABLE IF NOT EXISTS will silently skip creation and the INSERT will duplicate data into the existing v2 table
  • Use SET alter_sync = 2; SET mutations_sync = 2; in migrations to ensure synchronous execution on ClickHouse Cloud

References

  • ClickHouse Cloud SharedMergeTree differences: SharedMergeTree engine has restrictions on operations that require cross-shard coordination
  • golang-migrate ClickHouse driver: github.com/golang-migrate/migrate with clickhouse driver

© divinevideo, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/clickhouse-cloud-multi-table-rename of divinevideo/divine-mobile.

Open the folder on GitHubat commit 6487b05

Compare with similar skills

Clickhouse Cloud Multi Table Rename next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clickhouse Cloud Multi Table Rename compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clickhouse Cloud Multi Table Rename this skilldivinevideo/divine-mobile266—~1.4kAutomated safety check: PassMPL-2.0
Clickhouse Logs Queriessupabase/supabase111k—~2.4kAutomated safety check: PassApache-2.0
Keeper Stress AnalysisClickHouse/ClickHouse50k—~4.7kAutomated safety check: PassApache-2.0
Perf ComparisonClickHouse/ClickHouse50k—~3.9kAutomated safety check: NotesApache-2.0
Patch Release CheckClickHouse/ClickHouse50k—~4kAutomated safety check: NotesApache-2.0
Chdb SQLvemetric/vemetric3951 repos~1.2kAutomated safety check: PassApache-2.0

Similar skills

  • Clickhouse Logs Queries

    supabase/supabase

    Official

    Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).

    111k GitHub stars~2.4k tokensUpdated today
    DatabasesAuto-check passed
  • Keeper Stress Analysis

    ClickHouse/ClickHouse

    Analyze ClickHouse Keeper stress-test results from play.clickhouse.com / keeperstresstests data warehouse.

    50k GitHub stars~4.7k tokensUpdated today
    DatabasesAuto-check passed
  • Perf Comparison

    ClickHouse/ClickHouse

    Evaluate ClickHouse performance test results from existing CI/dashboard data or local perf.py runs.

    50k GitHub stars~3.9k tokensUpdated today
    DatabasesAuto-check: notes
  • Patch Release Check

    ClickHouse/ClickHouse

    Check whether ClickHouse's supported versions (last 3 majors + latest LTS) have recent stable patch releases, diagnose why the scheduled AutoReleases pipeline failed, and identify which releases…

    50k GitHub stars~4k tokensUpdated today
    DatabasesAuto-check: notes
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    395 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Bisect

    ClickHouse/ClickHouse

    Bisect a ClickHouse regression using pre-built master binaries from CI.

    50k GitHub stars~1.4k tokensUpdated today
    DatabasesAuto-check passed

More from divinevideo/divine-mobile

All 103 skills in this repo
  • Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y".

    266 GitHub stars~931 tokensUpdated today
    Auto-check passed
  • Art Direct

    divinevideo/divine-mobile

    Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language.

    266 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Async Await Null Race Condition

    divinevideo/divine-mobile

    Fix "Null check operator used on a null value" errors when an object is set to null during an async await.

    266 GitHub stars~881 tokensUpdated today
    Auto-check passed
  • AWS V4 Signing Custom Headers Gcs

    divinevideo/divine-mobile

    Add custom metadata headers (x-amz-meta-) to AWS v4 signed requests for GCS S3-compatible API.

    266 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Bash Herestring Newline Secrets

    divinevideo/divine-mobile

    Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings.

    266 GitHub stars~791 tokensUpdated today
    Auto-check passed
  • Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp).

    266 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Clickhouse Cloud Multi Table Rename

What does Clickhouse Cloud Multi Table Rename do?

Fix ClickHouse Cloud migration failures caused by multi-table RENAME statements. Clickhouse Cloud Multi Table Rename is an agent skill from divinevideo/divine-mobile. Fix ClickHouse Cloud migration failures caused by multi-table RENAME statements.

When should I use Clickhouse Cloud Multi Table Rename?

Clickhouse Cloud Multi Table Rename fits situations like: migration fails with Database X is Shared; it does not support renaming of multiple tables in single query; other migration tools show dirty database version after a table-swap migration on ClickHouse Cloud; schema migration works on self-hosted ClickHouse but fails on ClickHouse Cloud.

How do I install Clickhouse Cloud Multi Table Rename in Claude Code?

Run `npx skills add divinevideo/divine-mobile --skill clickhouse-cloud-multi-table-rename -a claude-code`. Or copy the skill folder (.agents/skills/clickhouse-cloud-multi-table-rename in divinevideo/divine-mobile) into .claude/skills/clickhouse-cloud-multi-table-rename in your project. Claude Code loads it when a task matches its description.

How do I install Clickhouse Cloud Multi Table Rename in Codex?

Run `npx skills add divinevideo/divine-mobile --skill clickhouse-cloud-multi-table-rename -a codex`. Or copy the skill folder (.agents/skills/clickhouse-cloud-multi-table-rename in divinevideo/divine-mobile) into .agents/skills/clickhouse-cloud-multi-table-rename in your project. Codex loads it when a task matches its description.

Can I use Clickhouse Cloud Multi Table Rename in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add divinevideo/divine-mobile --skill clickhouse-cloud-multi-table-rename -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clickhouse-cloud-multi-table-rename, .gemini/skills/clickhouse-cloud-multi-table-rename, .github/skills/clickhouse-cloud-multi-table-rename and .opencode/skills/clickhouse-cloud-multi-table-rename in your project.

What does Clickhouse Cloud Multi Table Rename need to run?

Going by SKILL.md and its folder, Clickhouse Cloud Multi Table Rename needs the command-line tools its instructions call (curl).

Does Clickhouse Cloud Multi Table Rename access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Clickhouse Cloud Multi Table Rename safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clickhouse Cloud Multi Table Rename use?

Clickhouse Cloud Multi Table Rename is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clickhouse Cloud Multi Table Rename use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Clickhouse Cloud Multi Table Rename?

Skills that share tags, products or a category with Clickhouse Cloud Multi Table Rename: Clickhouse Logs Queries (supabase/supabase, 111k stars), Keeper Stress Analysis (ClickHouse/ClickHouse, 50k stars), Perf Comparison (ClickHouse/ClickHouse, 50k stars) and Patch Release Check (ClickHouse/ClickHouse, 50k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clickhouse Cloud Multi Table Rename?

divinevideo (a GitHub organization) maintains it in divinevideo/divine-mobile, which has 266 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 9, 2026.

Source: divinevideo/divine-mobile on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.