diff --git a/hc/accounts/migrations/0022_auto_20190114_0857.py b/hc/accounts/migrations/0022_auto_20190114_0857.py new file mode 100644 index 00000000..290ffd81 --- /dev/null +++ b/hc/accounts/migrations/0022_auto_20190114_0857.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1.5 on 2019-01-14 08:57 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0021_auto_20190112_2005'), + ] + + operations = [ + migrations.AlterField( + model_name='member', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Project'), + ), + ] diff --git a/hc/accounts/models.py b/hc/accounts/models.py index 000052db..f80b5307 100644 --- a/hc/accounts/models.py +++ b/hc/accounts/models.py @@ -246,4 +246,4 @@ class Project(models.Model): class Member(models.Model): team = models.ForeignKey(Profile, models.CASCADE) user = models.ForeignKey(User, models.CASCADE, related_name="memberships") - project = models.ForeignKey(Project, models.CASCADE, null=True) + project = models.ForeignKey(Project, models.CASCADE) diff --git a/hc/api/migrations/0056_auto_20190114_0857.py b/hc/api/migrations/0056_auto_20190114_0857.py new file mode 100644 index 00000000..977ece03 --- /dev/null +++ b/hc/api/migrations/0056_auto_20190114_0857.py @@ -0,0 +1,24 @@ +# Generated by Django 2.1.5 on 2019-01-14 08:57 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0055_auto_20190112_1427'), + ] + + operations = [ + migrations.AlterField( + model_name='channel', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Project'), + ), + migrations.AlterField( + model_name='check', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Project'), + ), + ] diff --git a/hc/api/models.py b/hc/api/models.py index 841639a3..b604e78a 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -68,7 +68,7 @@ class Check(models.Model): code = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) desc = models.TextField(blank=True) user = models.ForeignKey(User, models.CASCADE) - project = models.ForeignKey(Project, models.CASCADE, null=True) + project = models.ForeignKey(Project, models.CASCADE) created = models.DateTimeField(auto_now_add=True) kind = models.CharField(max_length=10, default="simple", choices=CHECK_KINDS) @@ -264,7 +264,7 @@ class Channel(models.Model): name = models.CharField(max_length=100, blank=True) code = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) user = models.ForeignKey(User, models.CASCADE) - project = models.ForeignKey(Project, models.CASCADE, null=True,) + project = models.ForeignKey(Project, models.CASCADE) created = models.DateTimeField(auto_now_add=True) kind = models.CharField(max_length=20, choices=CHANNEL_KINDS) value = models.TextField(blank=True)