Example #1
0
 def backwards_dist(self) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(StorageSetKey.EVENTS, "errors_dist",
                               "http_method"),
         operations.DropColumn(StorageSetKey.EVENTS, "errors_dist",
                               "http_referer"),
     ]
Example #2
0
 def __backwards_migrations(self, table_name: str) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(StorageSetKey.TRANSACTIONS, table_name, "type"),
         operations.DropColumn(StorageSetKey.TRANSACTIONS, table_name, "message"),
         operations.DropColumn(StorageSetKey.TRANSACTIONS, table_name, "title"),
         operations.DropColumn(StorageSetKey.TRANSACTIONS, table_name, "timestamp"),
     ]
Example #3
0
 def backwards_dist(self) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(StorageSetKey.TRANSACTIONS,
                               "transactions_dist", "http_method"),
         operations.DropColumn(StorageSetKey.TRANSACTIONS,
                               "transactions_dist", "http_referer"),
     ]
Example #4
0
 def forwards_local(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(StorageSetKey.OUTCOMES, "outcomes_raw_local",
                               "size"),
         operations.DropColumn(StorageSetKey.OUTCOMES,
                               "outcomes_hourly_local", "bytes_received"),
     ]
Example #5
0
 def backwards_dist(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(StorageSetKey.EVENTS, "errors_dist",
                               "hierarchical_hashes"),
         operations.DropColumn(StorageSetKey.EVENTS, "sentry_dist",
                               "hierarchical_hashes"),
     ]
 def backwards_local(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(StorageSetKey.SESSIONS, "sessions_raw_local",
                               column.name)
         for [column, after] in new_raw_columns
     ] + [
         operations.DropColumn(StorageSetKey.SESSIONS,
                               "sessions_hourly_local", column.name)
         for [column, after] in new_dest_columns
     ]
 def forwards_dist(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_dist",
             column_name="_tags_flattened",
         ),
         operations.DropColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_dist",
             column_name="_contexts_flattened",
         ),
     ]
 def __backward_migrations(
         self, table_name: str) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(
             storage_set=StorageSetKey.DISCOVER,
             table_name=table_name,
             column_name="_tags_hash_map",
         ),
         operations.DropColumn(
             storage_set=StorageSetKey.DISCOVER,
             table_name=table_name,
             column_name="deleted",
         ),
     ]
Example #9
0
 def backwards_dist(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_raw_dist", "quantity"
         ),
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_raw_dist", "category"
         ),
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_hourly_dist", "quantity"
         ),
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_hourly_dist", "category"
         ),
     ]
Example #10
0
 def backwards_dist(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(
             storage_set=StorageSetKey.GENERIC_METRICS_SETS,
             table_name=self.table_name,
             column_name=self.new_column.name,
         )
     ]
Example #11
0
 def backwards_dist(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(
             StorageSetKey.TRANSACTIONS,
             "transactions_dist",
             "spans.exclusive_time_32",
         ),
     ]
 def __backwards_migrations(
         self, table_name: str) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(
             storage_set=StorageSetKey.DISCOVER,
             table_name=table_name,
             column_name="trace_id",
         ),
     ]
Example #13
0
 def backwards_local(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_raw_local", "quantity"
         ),
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_raw_local", "category"
         ),
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_hourly_local", "quantity"
         ),
         operations.RunSql(
             storage_set=StorageSetKey.OUTCOMES,
             statement="""
                 ALTER TABLE outcomes_hourly_local
                 MODIFY ORDER BY (org_id, project_id, key_id, outcome, reason, timestamp);
             """,
         ),
         operations.DropColumn(
             StorageSetKey.OUTCOMES, "outcomes_hourly_local", "category"
         ),
     ]
 def __backwards_migrations(
         self, table_name: str) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(StorageSetKey.QUERYLOG, table_name,
                               "clickhouse_queries.all_columns"),
         operations.DropColumn(StorageSetKey.QUERYLOG, table_name,
                               "clickhouse_queries.or_conditions"),
         operations.DropColumn(StorageSetKey.QUERYLOG, table_name,
                               "clickhouse_queries.where_columns"),
         operations.DropColumn(
             StorageSetKey.QUERYLOG,
             table_name,
             "clickhouse_queries.where_mapping_columns",
         ),
         operations.DropColumn(StorageSetKey.QUERYLOG, table_name,
                               "clickhouse_queries.groupby_columns"),
         operations.DropColumn(
             StorageSetKey.QUERYLOG,
             table_name,
             "clickhouse_queries.array_join_columns",
         ),
     ]
 def forwards_local(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.ModifyColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column("duration", UInt(32)),
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "sdk_name", String(Modifiers(low_cardinality=True, default="''"))
             ),
             after="user_email",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "sdk_version", String(Modifiers(low_cardinality=True, default="''"))
             ),
             after="sdk_name",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "transaction_status",
                 UInt(8, Modifiers(default=str(UNKNOWN_SPAN_STATUS))),
             ),
             after="transaction_op",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column("_tags_flattened", String()),
             after="tags",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column("_contexts_flattened", String()),
             after="contexts",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "user_hash", UInt(64, Modifiers(materialized="cityHash64(user)"))
             ),
             after="user",
         ),
         # The following columns were originally created as non low cardinality strings
         operations.ModifyColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "transaction_name", String(Modifiers(low_cardinality=True))
             ),
         ),
         operations.ModifyColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "release", String(Modifiers(nullable=True, low_cardinality=True))
             ),
         ),
         operations.ModifyColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "dist", String(Modifiers(nullable=True, low_cardinality=True))
             ),
         ),
         operations.ModifyColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "sdk_name", String(Modifiers(low_cardinality=True, default="''"))
             ),
         ),
         operations.ModifyColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "sdk_version", String(Modifiers(low_cardinality=True, default="''"))
             ),
         ),
         operations.ModifyColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column(
                 "environment",
                 String(Modifiers(nullable=True, low_cardinality=True)),
             ),
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column=Column("message_timestamp", DateTime()),
             after="offset",
         ),
         operations.DropColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column_name="_start_date",
         ),
         operations.DropColumn(
             storage_set=StorageSetKey.TRANSACTIONS,
             table_name="transactions_local",
             column_name="_finish_date",
         ),
     ]
Example #16
0
 def backwards_dist(self) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(
             StorageSetKey.TRANSACTIONS, "transactions_dist", "measurements"
         )
     ]
 def forwards_local(self) -> Sequence[operations.Operation]:
     return [
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("group_id", UInt(64)),
             after="project_id",
         ),
         operations.DropColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column_name="device_model",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("sdk_integrations", Array(String())),
             after="exception_frames",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("modules.name", Nested([("name", String())])),
             after="sdk_integrations",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("culprit", Nullable(String())),
             after="sdk_integrations",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("search_message", Nullable(String())),
             after="received",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("title", Nullable(String())),
             after="search_message",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("location", Nullable(String())),
             after="title",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("_tags_flattened", String()),
             after="tags",
         ),
         operations.AddColumn(
             storage_set=StorageSetKey.EVENTS,
             table_name="sentry_local",
             column=Column("message_timestamp", DateTime()),
             after="partition",
         ),
     ]
Example #18
0
 def backwards_dist(self) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(StorageSetKey.TRANSACTIONS,
                               "transactions_dist", "_tags_hash_map")
     ]
Example #19
0
 def backwards_local(self) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(StorageSetKey.EVENTS, "sentry_local",
                               "_tags_hash_map"),
     ]
Example #20
0
 def backwards_dist(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropColumn(StorageSetKey.TRANSACTIONS,
                               "transactions_dist", "span_op_breakdowns")
     ]
Example #21
0
 def backwards_dist(self) -> Sequence[operations.Operation]:
     return [
         operations.DropColumn(StorageSetKey.EVENTS, "errors_dist",
                               "_tags_hash_map")
     ]