File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
snuba/snuba_migrations/events_analytics_platform Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ from typing import Sequence
2+
3+ from snuba .clusters .storage_sets import StorageSetKey
4+ from snuba .migrations import migration , operations
5+ from snuba .migrations .operations import OperationTarget , SqlOperation
6+
7+
8+ class Migration (migration .ClickhouseNodeMigration ):
9+
10+ blocking = False
11+ storage_set_key = StorageSetKey .EVENTS_ANALYTICS_PLATFORM
12+
13+ local_table_name = "eap_trace_item_attrs_local"
14+ dist_table_name = "eap_trace_item_attrs_dist"
15+ mv_name = "eap_trace_item_attrs_mv"
16+
17+ def forwards_ops (self ) -> Sequence [SqlOperation ]:
18+ return [
19+ operations .DropTable (
20+ storage_set = self .storage_set_key ,
21+ table_name = self .mv_name ,
22+ target = OperationTarget .LOCAL ,
23+ ),
24+ operations .DropTable (
25+ storage_set = self .storage_set_key ,
26+ table_name = self .local_table_name ,
27+ target = OperationTarget .LOCAL ,
28+ ),
29+ operations .DropTable (
30+ storage_set = self .storage_set_key ,
31+ table_name = self .dist_table_name ,
32+ target = OperationTarget .DISTRIBUTED ,
33+ ),
34+ ]
35+
36+ def backwards_ops (self ) -> Sequence [SqlOperation ]:
37+ # we won't go back!
38+ return []
You can’t perform that action at this time.
0 commit comments