X Tutup
Skip to content

fix: drop legacy clickhouse tables and remove v1 schema#5230

Draft
Flo4604 wants to merge 1 commit intofix/drop-v2-verification-aggregation-chainfrom
fix/drop-legacy-clickhouse-tables
Draft

fix: drop legacy clickhouse tables and remove v1 schema#5230
Flo4604 wants to merge 1 commit intofix/drop-v2-verification-aggregation-chainfrom
fix/drop-legacy-clickhouse-tables

Conversation

@Flo4604
Copy link
Member

@Flo4604 Flo4604 commented Mar 6, 2026

What does this PR do?

This PR removes all legacy ClickHouse schema definitions and adds a migration to drop the corresponding database objects. The legacy v1 schema in separate databases (verifications, ratelimits, metrics, billing, business) is being fully replaced by the v2/v3 schema in the default database.

The migration drops materialized views, tables, and databases in the correct dependency order to avoid foreign key constraint issues. Additionally, temporary sync materialized views that were bridging data from v1 to v2 during the migration period are also removed.

Fixes # (issue)

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Verify the migration runs successfully against a test ClickHouse instance with legacy schema
  • Confirm all legacy databases, tables, and views are properly dropped
  • Ensure the new v2/v3 schema in the default database continues to function correctly
  • Test that applications using the new schema are unaffected

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Ran make fmt on /go directory
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

@vercel
Copy link

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboard Ready Ready Preview, Comment Mar 6, 2026 6:38pm

Request Review

Copy link
Member Author

Flo4604 commented Mar 6, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 506730f8-3213-4e8a-8bf8-10cd820bae1e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/drop-legacy-clickhouse-tables

Comment @coderabbitai help to get the list of available commands and usage tips.

@Flo4604 Flo4604 changed the base branch from fix/drop-v2-from-allowed-tables to graphite-base/5230 March 6, 2026 18:31
@Flo4604 Flo4604 force-pushed the fix/drop-legacy-clickhouse-tables branch from 42dfb06 to e2335dd Compare March 6, 2026 18:31
@Flo4604 Flo4604 force-pushed the fix/drop-legacy-clickhouse-tables branch from e2335dd to f8c6489 Compare March 6, 2026 18:35
@Flo4604 Flo4604 changed the base branch from graphite-base/5230 to fix/drop-v2-verification-aggregation-chain March 6, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup