Skip to content

Commit

Permalink
fix: cascade delete versions when corresponding change request is del…
Browse files Browse the repository at this point in the history
…eted (#4152)
  • Loading branch information
matthewelwell authored Jun 12, 2024
1 parent c0f373a commit baf8ddb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.25 on 2024-06-12 14:43

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('workflows_core', '0009_prevent_cascade_delete_from_user_delete'),
('feature_versioning', '0002_add_api_key_for_creation_and_publish'),
]

operations = [
migrations.AlterField(
model_name='environmentfeatureversion',
name='change_request',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='environment_feature_versions', to='workflows_core.changerequest'),
),
]
2 changes: 1 addition & 1 deletion api/features/versioning/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class EnvironmentFeatureVersion(
change_request = models.ForeignKey(
"workflows_core.ChangeRequest",
related_name="environment_feature_versions",
on_delete=models.SET_NULL,
on_delete=models.CASCADE,
null=True,
blank=True,
)
Expand Down

0 comments on commit baf8ddb

Please sign in to comment.