Skip to content

Commit

Permalink
chore(eap-spans): Remove unused tables
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops committed Nov 8, 2024
1 parent 78c7a59 commit 36988dd
Showing 1 changed file with 33 additions and 0 deletions.
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

0 comments on commit 36988dd

Please sign in to comment.