-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ref(cells): Rename OrganizationSlugReservation.region_name to cell_name #110177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Generated by Django 5.2.11 on 2026-03-06 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
| 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", "1048_organizationmapping_cell_name_idx"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name="organizationslugreservation", | ||
| name="region_name", | ||
| field=models.CharField(db_column="region_name", max_length=48, null=False), | ||
| ), | ||
| migrations.RenameField( | ||
| model_name="organizationslugreservation", | ||
| old_name="region_name", | ||
| new_name="cell_name", | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,8 +35,7 @@ class OrganizationSlugReservation(ReplicatedControlModel): | |
| slug = models.SlugField(unique=True, null=False) | ||
| organization_id = HybridCloudForeignKey("sentry.organization", null=False, on_delete="CASCADE") | ||
| user_id = BoundedBigIntegerField(db_index=True, null=True) | ||
| # TODO(cells): rename to cell_name | ||
| region_name = models.CharField(max_length=REGION_NAME_LENGTH, null=False) | ||
| cell_name = models.CharField(max_length=REGION_NAME_LENGTH, null=False, db_column="region_name") | ||
| reservation_type = BoundedBigIntegerField( | ||
| choices=OrganizationSlugReservationType.as_choices(), | ||
| null=False, | ||
|
Comment on lines
35
to
41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: An Suggested FixIn Prompt for AI Agent |
||
|
|
@@ -68,7 +67,7 @@ def update(self, *args: Any, **kwds: Any): | |
| return super().update(*args, **kwds) | ||
|
|
||
| def outbox_region_names(self) -> Collection[str]: | ||
| return [self.region_name] | ||
| return [self.cell_name] | ||
|
|
||
| def handle_async_replication(self, region_name: str, shard_identifier: int) -> None: | ||
| from sentry.hybridcloud.services.control_organization_provisioning.serial import ( | ||
|
|
@@ -78,7 +77,7 @@ def handle_async_replication(self, region_name: str, shard_identifier: int) -> N | |
|
|
||
| serialized = serialize_slug_reservation(self) | ||
| region_replica_service.upsert_replicated_org_slug_reservation( | ||
| slug_reservation=serialized, region_name=self.region_name | ||
| slug_reservation=serialized, region_name=self.cell_name | ||
| ) | ||
|
|
||
| @classmethod | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.