Skip to content

Commit

Permalink
Drop dist migrations first
Browse files Browse the repository at this point in the history
  • Loading branch information
cmanallen committed Jan 8, 2025
1 parent 246e395 commit 85d521c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snuba/snuba_migrations/events/0025_add_features_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from snuba.migrations.columns import MigrationModifiers as Modifiers
from snuba.migrations.operations import OperationTarget

table_names = [
migration_meta = [
("errors_local", StorageSetKey.EVENTS, OperationTarget.LOCAL),
("errors_dist", StorageSetKey.EVENTS, OperationTarget.DISTRIBUTED),
("errors_dist_ro", StorageSetKey.EVENTS_RO, OperationTarget.DISTRIBUTED),
Expand All @@ -26,7 +26,7 @@ def backwards_ops(self) -> Sequence[operations.SqlOperation]:

def forward_ops() -> Iterator[operations.SqlOperation]:
# Add local and dist columns for the three tables.
for table_name, storage_set, target in table_names:
for table_name, storage_set, target in migration_meta:
yield from [
operations.AddColumn(
storage_set=storage_set,
Expand Down Expand Up @@ -72,7 +72,7 @@ def backward_ops() -> Iterator[operations.SqlOperation]:
target=OperationTarget.LOCAL,
)

for table_name, storage_set, target in table_names:
for table_name, storage_set, target in reversed(migration_meta):
yield from [
operations.DropColumn(
storage_set=storage_set,
Expand Down

0 comments on commit 85d521c

Please sign in to comment.