-
Notifications
You must be signed in to change notification settings - Fork 17
fix: split multi-statement ClickHouse golang-migrate migrations #1420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adaam2
wants to merge
1
commit into
main
Choose a base branch
from
fix/out-of-order-migs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234446_drop-http-route-index.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD INDEX `idx_telemetry_logs_http_route` ((http_route)) TYPE bloom_filter(0.01) GRANULARITY 1; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234446_drop-http-route-index.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP INDEX `idx_telemetry_logs_http_route`; |
1 change: 0 additions & 1 deletion
1
...4446_drop-telemetry-http-indices.down.sql → ...129234447_drop-http-status-index.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD INDEX `idx_telemetry_logs_http_status` ((http_response_status_code)) TYPE set(100) GRANULARITY 4; | ||
| ALTER TABLE `telemetry_logs` ADD INDEX `idx_telemetry_logs_http_route` ((http_route)) TYPE bloom_filter(0.01) GRANULARITY 1; |
1 change: 0 additions & 1 deletion
1
...234446_drop-telemetry-http-indices.up.sql → ...60129234447_drop-http-status-index.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP INDEX `idx_telemetry_logs_http_route`; | ||
| ALTER TABLE `telemetry_logs` DROP INDEX `idx_telemetry_logs_http_status`; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234510_drop-http-request-method-col.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD COLUMN `http_request_method` LowCardinality(Nullable(String)) COMMENT 'HTTP method (GET, POST, etc.) - null for non-HTTP logs.'; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234510_drop-http-request-method-col.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP COLUMN `http_request_method`; |
4 changes: 0 additions & 4 deletions
4
server/clickhouse/local/golang_migrate/20260129234510_drop-telemetry-http-cols.down.sql
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
server/clickhouse/local/golang_migrate/20260129234510_drop-telemetry-http-cols.up.sql
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...lickhouse/local/golang_migrate/20260129234511_drop-http-response-status-code-col.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD COLUMN `http_response_status_code` Nullable(Int32) COMMENT 'HTTP status code - null for non-HTTP logs.'; |
1 change: 1 addition & 0 deletions
1
.../clickhouse/local/golang_migrate/20260129234511_drop-http-response-status-code-col.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP COLUMN `http_response_status_code`; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234512_drop-http-route-col.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD COLUMN `http_route` Nullable(String) COMMENT 'HTTP route pattern (/api/v1/users) - null for non-HTTP logs.'; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234512_drop-http-route-col.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP COLUMN `http_route`; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234513_drop-http-server-url-col.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD COLUMN `http_server_url` Nullable(String) COMMENT 'HTTP server URL - null for non-HTTP logs.' CODEC(ZSTD(1)); |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260129234513_drop-http-server-url-col.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP COLUMN `http_server_url`; |
3 changes: 0 additions & 3 deletions
3
...er/clickhouse/local/golang_migrate/20260130010009_add-chat-id-and-timestamp-cols.down.sql
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
server/clickhouse/local/golang_migrate/20260130010009_add-chat-id-and-timestamp-cols.up.sql
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260130010009_add-observed-timestamp-col.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP COLUMN `observed_timestamp`; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260130010009_add-observed-timestamp-col.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD COLUMN `observed_timestamp` DateTime64(9) DEFAULT fromUnixTimestamp64Nano(observed_time_unix_nano) COMMENT 'Human-readable timestamp derived from observed_time_unix_nano.'; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260130010010_add-chat-id-col.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP COLUMN `gram_chat_id`; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260130010010_add-chat-id-col.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD COLUMN `gram_chat_id` Nullable(String) COMMENT 'The Chat ID associated with the log (if generated by chat).'; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260130010011_add-chat-id-index.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` DROP INDEX `idx_telemetry_logs_chat_id`; |
1 change: 1 addition & 0 deletions
1
server/clickhouse/local/golang_migrate/20260130010011_add-chat-id-index.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `telemetry_logs` ADD INDEX `idx_telemetry_logs_chat_id` ((gram_chat_id)) TYPE bloom_filter(0.01) GRANULARITY 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,14 @@ | ||
| h1:LWQjNXTcZdYBt7OLGfYkh2nOcy6RwCmvLGwlmtJF2pQ= | ||
| h1:ACpWtLBg0jfhAxqXZe/EdSYm8ZoT1yyDm5nxTDIKNpo= | ||
| 20251127155815_initial_golang_migrate.up.sql h1:fkATa14aucJEoldFi1VgW7TRT8gyC6NGe1Hq/OzXVuI= | ||
| 20251208142630_add-tool-logs-table.up.sql h1:cGJCiWBvLPFwOlpx0jYYLgdPZD21+gKSF/x4mVksBcI= | ||
| 20251209104438_add-id-col-to-tool-logs-table.up.sql h1:+Ubsl1ZKfeCZL9dBhohUnkBksKZj6nwdZSXm7WwowaE= | ||
| 20251217163326_add-telemetry-logs-table.up.sql h1:9nsauxhOm4lo/DddEKbpJy+ZeVdbT1FQYUi6rw82V1A= | ||
| 20260129234446_drop-telemetry-http-indices.up.sql h1:L18/S7TPIDosAB8a+0zNdvNbGxy+cGhfCJpzrxTFC6E= | ||
| 20260129234510_drop-telemetry-http-cols.up.sql h1:c/0WDD+1s4WC2eyN2YKrRPnPxoU+tX+SPPxG+XnJ22k= | ||
| 20260130010009_add-chat-id-and-timestamp-cols.up.sql h1:UUgfXMrzmv/+tIfZB9BMCGLZifIE9Hp4qXG8js+6oLM= | ||
| 20260129234446_drop-http-route-index.up.sql h1:R8SLTZfZTQq5rTNh4UbhhWkldbYd/2gSClQFw12KNmg= | ||
| 20260129234447_drop-http-status-index.up.sql h1:BQYK1jLKWvEUxUtBTrp6/g1k9DALX4U0XOfrkHz1/Rk= | ||
| 20260129234510_drop-http-request-method-col.up.sql h1:SOD+ajfAha5+oqpdREzGkT4yufhiWLNB0qeeRJxkv9Y= | ||
| 20260129234511_drop-http-response-status-code-col.up.sql h1:3BIqbH9lDNoN7c16a41I7RCypcQFrQcbNvGNmnvv1OY= | ||
| 20260129234512_drop-http-route-col.up.sql h1:xWUkOgXQ0bAoIVqbEMjoCd+EaG0JFSGbXpCm10OuqTg= | ||
| 20260129234513_drop-http-server-url-col.up.sql h1:8oC3hfT/pCNuI2bn9S953G1BkWoyLWyL2d0x9aua/Zk= | ||
| 20260130010009_add-observed-timestamp-col.up.sql h1:BCy9z/s1l50ITqguAbGGJ921JSZGUZBJPgHsWhCZpzI= | ||
| 20260130010010_add-chat-id-col.up.sql h1:zdp3GwKaNsaCPpW2jTfbYV5w4tu13j09cOAy2DIFr2U= | ||
| 20260130010011_add-chat-id-index.up.sql h1:O/I1tFR5/arZ0XxQV5Hz536I7Rkr8ssx7fo6UC990K0= |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did these get renamed? I don't believe this should go in because it's completely unrelated with the clickhouse issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a result of running
clickhouse rebasei believe but might be wrong - the original issue i ran into was out of order migrationsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that these migrations are not clickhouse migrations - they're PG migrations, which was what stood out to me 🤔