-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the errors backfill script into a migration. Also adds a migration to truncate the events table once the data is copied to the new table. This also flips the switch on the errors rollout so that we are now using the new table. This will affect onpremise, Sentry dev and CI environments.
- Loading branch information
Showing
8 changed files
with
125 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
28 changes: 28 additions & 0 deletions
28
snuba/migrations/snuba_migrations/events/0015_truncate_events.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,28 @@ | ||
from typing import Sequence | ||
|
||
from snuba.clusters.storage_sets import StorageSetKey | ||
from snuba.migrations import migration, operations | ||
|
||
|
||
class Migration(migration.ClickhouseNodeMigration): | ||
""" | ||
Truncate the events table. Cannot be reversed. | ||
""" | ||
|
||
blocking = False | ||
|
||
def forwards_local(self) -> Sequence[operations.SqlOperation]: | ||
return [ | ||
operations.TruncateTable( | ||
storage_set=StorageSetKey.EVENTS, table_name="sentry_local" | ||
) | ||
] | ||
|
||
def backwards_local(self) -> Sequence[operations.SqlOperation]: | ||
return [] | ||
|
||
def forwards_dist(self) -> Sequence[operations.SqlOperation]: | ||
return [] | ||
|
||
def backwards_dist(self) -> Sequence[operations.SqlOperation]: | ||
return [] |
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
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
This file was deleted.
Oops, something went wrong.
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