1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

change migration to allow blank inventory field

This commit is contained in:
AlanCoding 2016-04-08 12:30:57 -04:00
parent 68d8d25d64
commit f471f9b072
2 changed files with 13 additions and 0 deletions

View File

@ -2,6 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings from django.conf import settings
@ -32,4 +33,14 @@ class Migration(migrations.Migration):
name='ask_tags_on_launch', name='ask_tags_on_launch',
field=models.BooleanField(default=False), field=models.BooleanField(default=False),
), ),
migrations.AlterField(
model_name='job',
name='inventory',
field=models.ForeignKey(related_name='jobs', on_delete=django.db.models.deletion.SET_NULL, default=None, blank=True, to='main.Inventory', null=True),
),
migrations.AlterField(
model_name='jobtemplate',
name='inventory',
field=models.ForeignKey(related_name='jobtemplates', on_delete=django.db.models.deletion.SET_NULL, default=None, blank=True, to='main.Inventory', null=True),
),
] ]

View File

@ -53,7 +53,9 @@ class JobOptions(BaseModel):
inventory = models.ForeignKey( inventory = models.ForeignKey(
'Inventory', 'Inventory',
related_name='%(class)ss', related_name='%(class)ss',
blank=True,
null=True, null=True,
default=None,
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
) )
project = models.ForeignKey( project = models.ForeignKey(