dj22: add on_delete=CASCADE to migrations (#36707)

This commit is contained in:
Benjamin Dauvergne 2019-10-05 10:27:13 +02:00
parent 2cc9c1f05a
commit 8471bf5e32
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ class Migration(migrations.Migration):
('value', models.TextField(help_text='start with [ or { for a JSON document', verbose_name='value', blank=True)),
('service_pk', models.PositiveIntegerField(null=True)),
('last_update_timestamp', models.DateTimeField(auto_now=True, null=True)),
('service_type', models.ForeignKey(to='contenttypes.ContentType', null=True)),
('service_type', models.ForeignKey(to='contenttypes.ContentType', null=True, on_delete=models.CASCADE)),
],
options={
},

View File

@ -51,7 +51,7 @@ class Variable(models.Model):
blank=True,
help_text=_('start with [ or { for a JSON document'))
auto = models.BooleanField(default=False)
service_type = models.ForeignKey(ContentType, null=True)
service_type = models.ForeignKey(ContentType, null=True, on_delete=models.CASCADE)
service_pk = models.PositiveIntegerField(null=True)
service = GenericForeignKey('service_type', 'service_pk')
last_update_timestamp = models.DateTimeField(auto_now=True, null=True)