Skip to content

Commit 6aaa964

Browse files
ref(db): Drop project_id from Environment (model state) (#45094)
1 parent 04032e8 commit 6aaa964

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

migrations_lockfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ To resolve this, rebase against latest master and regenerate your migration. Thi
66
will then be regenerated, and you should be able to merge without conflicts.
77

88
nodestore: 0002_nodestore_no_dictfield
9-
sentry: 0363_debug_id_artifact_bundle
9+
sentry: 0364_remove_project_id_from_environment
1010
social_auth: 0001_initial
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Generated by Django 2.2.28 on 2023-02-24 20:34
2+
3+
from django.db import migrations
4+
5+
from sentry.new_migrations.migrations import CheckedMigration
6+
7+
8+
class Migration(CheckedMigration):
9+
# This flag is used to mark that a migration shouldn't be automatically run in production. For
10+
# the most part, this should only be used for operations where it's safe to run the migration
11+
# after your code has deployed. So this should not be used for most operations that alter the
12+
# schema of a table.
13+
# Here are some things that make sense to mark as dangerous:
14+
# - Large data migrations. Typically we want these to be run manually by ops so that they can
15+
# be monitored and not block the deploy for a long period of time while they run.
16+
# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
17+
# have ops run this and not block the deploy. Note that while adding an index is a schema
18+
# change, it's completely safe to run the operation after the code has deployed.
19+
is_dangerous = False
20+
21+
dependencies = [
22+
("sentry", "0363_debug_id_artifact_bundle"),
23+
]
24+
25+
operations = [
26+
migrations.SeparateDatabaseAndState(
27+
database_operations=[],
28+
state_operations=[
29+
migrations.RemoveField(
30+
model_name="environment",
31+
name="project_id",
32+
),
33+
],
34+
),
35+
]

src/sentry/models/environment.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class Environment(Model):
3838

3939
organization_id = BoundedBigIntegerField()
4040
projects = models.ManyToManyField("sentry.Project", through=EnvironmentProject)
41-
# DEPRECATED, use projects
42-
project_id = BoundedBigIntegerField(null=True)
4341
name = models.CharField(max_length=64)
4442
date_added = models.DateTimeField(default=timezone.now)
4543

0 commit comments

Comments
 (0)