From cf8675e4cacc577f3e12f0d3fd89eae9d9ad0501 Mon Sep 17 00:00:00 2001 From: Cathy Teng Date: Thu, 29 May 2025 09:36:42 -0700 Subject: [PATCH 1/2] update migration --- migrations_lockfile.txt | 2 +- ...ncrease_orgmember_user_email_max_length.py | 33 +++++++++++++++++++ src/sentry/models/organizationmember.py | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py diff --git a/migrations_lockfile.txt b/migrations_lockfile.txt index bb26e396b5a350..0e86af4fd86263 100644 --- a/migrations_lockfile.txt +++ b/migrations_lockfile.txt @@ -23,7 +23,7 @@ preprod: 0001_emerge_upload_models replays: 0001_squashed_0005_drop_replay_index -sentry: 0913_split_discover_dataset_dashboards_self_hosted +sentry: 0914_increase_orgmember_user_email_max_length social_auth: 0001_squashed_0002_default_auto_field diff --git a/src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py b/src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py new file mode 100644 index 00000000000000..5c5706d52a0d54 --- /dev/null +++ b/src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py @@ -0,0 +1,33 @@ +# Generated by Django 5.2.1 on 2025-05-22 22:17 + +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", "0914_increase_orgmember_user_email_max_length"), + ] + + operations = [ + migrations.AlterField( + model_name="organizationmember", + name="user_email", + field=models.CharField(blank=True, max_length=200, null=True), + ), + ] diff --git a/src/sentry/models/organizationmember.py b/src/sentry/models/organizationmember.py index febdcf95aae9cb..bf1aec86a2c120 100644 --- a/src/sentry/models/organizationmember.py +++ b/src/sentry/models/organizationmember.py @@ -237,7 +237,7 @@ class OrganizationMember(ReplicatedRegionModel): user_is_active = models.BooleanField(null=False, default=True, db_default=True) # Note, this is the email of the user that may or may not be associated with the member, not the email used to # invite the user. - user_email = models.CharField(max_length=75, null=True, blank=True) + user_email = models.CharField(max_length=200, null=True, blank=True) class Meta: app_label = "sentry" From 8ade0aa73fe0e0ac780dc778fe332fd1860e9071 Mon Sep 17 00:00:00 2001 From: Cathy Teng Date: Thu, 29 May 2025 09:47:47 -0700 Subject: [PATCH 2/2] fix dependency --- .../migrations/0914_increase_orgmember_user_email_max_length.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py b/src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py index 5c5706d52a0d54..b8327eeba39ed1 100644 --- a/src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py +++ b/src/sentry/migrations/0914_increase_orgmember_user_email_max_length.py @@ -21,7 +21,7 @@ class Migration(CheckedMigration): is_post_deployment = False dependencies = [ - ("sentry", "0914_increase_orgmember_user_email_max_length"), + ("sentry", "0913_split_discover_dataset_dashboards_self_hosted"), ] operations = [