Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion migrations_lockfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ hybridcloud: 0016_add_control_cacheversion
nodestore: 0002_nodestore_no_dictfield
remote_subscriptions: 0003_drop_remote_subscription
replays: 0004_index_together
sentry: 0783_remove_release_project_id
sentry: 0784_remove_broadcasts_cta_column
social_auth: 0002_default_auto_field
uptime: 0017_unique_on_timeout
workflow_engine: 0010_detector_state_unique_group
1 change: 0 additions & 1 deletion src/sentry/api/endpoints/broadcast_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def post(self, request: Request) -> Response:
title=result["title"],
message=result["message"],
link=result["link"],
cta=result.get("cta"),
is_active=result.get("isActive") or False,
date_expires=result.get("dateExpires"),
media_url=result.get("mediaUrl"),
Expand Down
1 change: 0 additions & 1 deletion src/sentry/api/serializers/models/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def serialize(self, obj, attrs, user, **kwargs):
"message": obj.message,
"title": obj.title,
"link": obj.link,
"cta": obj.cta,
"mediaUrl": obj.media_url,
"isActive": obj.is_active,
"dateCreated": obj.date_added,
Expand Down
34 changes: 34 additions & 0 deletions src/sentry/migrations/0784_remove_broadcasts_cta_column.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 5.1.1 on 2024-11-04 18:13

from django.db import migrations

from sentry.new_migrations.migrations import CheckedMigration


class Migration(CheckedMigration):
# This flag is used to mark that a migration shouldn't be automatically run in production.
# This should only be used for operations where it's safe to run the migration after your
# code has deployed. So this should not be used for most operations that alter the schema
# of a table.
# Here are some things that make sense to mark as post deployment:
# - Large data migrations. Typically we want these to be run manually so that they can be
# monitored and not block the deploy for a long period of time while they run.
# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
# run this outside deployments so that we don't block them. Note that while adding an index
# is a schema change, it's completely safe to run the operation after the code has deployed.
# Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment

is_post_deployment = False

dependencies = [
("sentry", "0783_remove_release_project_id"),
]

operations = [
migrations.SeparateDatabaseAndState(
database_operations=[],
state_operations=[
migrations.RemoveField(model_name="broadcast", name="cta"),
],
)
]
1 change: 0 additions & 1 deletion src/sentry/models/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Broadcast(Model):
is_active = models.BooleanField(default=True, db_index=True)
date_expires = models.DateTimeField(default=default_expiration, null=True, blank=True)
date_added = models.DateTimeField(default=timezone.now)
cta = models.CharField(max_length=256, null=True, blank=True)
media_url = models.URLField(null=True, blank=True)
category = models.CharField(choices=BROADCAST_CATEGORIES, max_length=32, null=True, blank=True)
created_by_id = FlexibleForeignKey("sentry.User", null=True, on_delete=models.SET_NULL)
Expand Down
1 change: 0 additions & 1 deletion tests/sentry/api/endpoints/test_broadcast_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def test_superuser(self):
broadcast = Broadcast.objects.get(id=response.data["id"])
assert broadcast.title == "bar"
assert broadcast.message == "foo"
assert broadcast.cta == "Read More"
assert broadcast.media_url == "http://example.com/image.png"
assert broadcast.category == "announcement"
assert broadcast.created_by_id == self.user
Expand Down