Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hub: worker field in Task table should not be cascade #226

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions kobo/hub/migrations/0004_alter_task_worker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.0.10 on 2023-08-30 08:41

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


class Migration(migrations.Migration):

dependencies = [
('hub', '0003_auto_20160202_0647'),
]

operations = [
migrations.AlterField(
model_name='task',
name='worker',
field=models.ForeignKey(blank=True, help_text='A worker which has this task assigned.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='hub.worker'),
),
]
2 changes: 1 addition & 1 deletion kobo/hub/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class Task(models.Model):
"""Model for hub_task table."""
archive = models.BooleanField(default=False, help_text=_("When a task is archived, it disappears from admin interface and cannot be accessed by taskd.<br />Make sure that archived tasks are finished and you won't need them anymore."))
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
worker = models.ForeignKey(Worker, null=True, blank=True, help_text=_("A worker which has this task assigned."), on_delete=models.CASCADE)
worker = models.ForeignKey(Worker, null=True, blank=True, help_text=_("A worker which has this task assigned."), on_delete=models.SET_NULL)
parent = models.ForeignKey("self", null=True, blank=True, help_text=_("Parent task."), on_delete=models.CASCADE)
state = models.PositiveIntegerField(default=TASK_STATES["FREE"], choices=TASK_STATES.get_mapping(), help_text=_("Current task state."))
label = models.CharField(max_length=255, blank=True, help_text=_("Label, description or any reason for this task."))
Expand Down
Loading