Browse Source

project_id must be not null.

pull/214/head
Pēteris Caune 6 years ago
parent
commit
34e54cca42
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
4 changed files with 46 additions and 3 deletions
  1. +19
    -0
      hc/accounts/migrations/0022_auto_20190114_0857.py
  2. +1
    -1
      hc/accounts/models.py
  3. +24
    -0
      hc/api/migrations/0056_auto_20190114_0857.py
  4. +2
    -2
      hc/api/models.py

+ 19
- 0
hc/accounts/migrations/0022_auto_20190114_0857.py View File

@ -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'),
),
]

+ 1
- 1
hc/accounts/models.py View File

@ -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)

+ 24
- 0
hc/api/migrations/0056_auto_20190114_0857.py View File

@ -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'),
),
]

+ 2
- 2
hc/api/models.py View File

@ -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)


Loading…
Cancel
Save