-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(eap-spans): Remove unused tables
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
snuba/snuba_migrations/events_analytics_platform/0018_drop_unused_span_tables.py
This file contains 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,33 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Sequence | ||
|
||
from snuba.clusters.storage_sets import StorageSetKey | ||
from snuba.migrations import migration, operations | ||
from snuba.migrations.operations import OperationTarget, SqlOperation | ||
|
||
unused_tables = { | ||
"eap_spans_local", | ||
"spans_num_attrs_2_local", | ||
"spans_num_attrs_2_mv", | ||
"spans_str_attrs_2_local", | ||
"spans_str_attrs_2_mv", | ||
} | ||
|
||
|
||
class Migration(migration.ClickhouseNodeMigration): | ||
blocking = False | ||
storage_set_key = StorageSetKey.EVENTS_ANALYTICS_PLATFORM | ||
|
||
def forwards_ops(self) -> Sequence[SqlOperation]: | ||
return [ | ||
operations.DropTable( | ||
storage_set=self.storage_set_key, | ||
table_name=table_name, | ||
target=OperationTarget.LOCAL, | ||
) | ||
for table_name in unused_tables | ||
] | ||
|
||
def backwards_ops(self) -> Sequence[SqlOperation]: | ||
pass |