Skip to content

Commit

Permalink
Fix field size for MySQL (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
benselme authored and auvipy committed Feb 10, 2022
1 parent d36a868 commit 6167179
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
11 changes: 10 additions & 1 deletion django_celery_results/migrations/0004_auto_20190516_0412.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='taskresult',
name='task_name',
field=models.CharField(db_index=True, help_text='Name of the Task which was run', max_length=255, null=True, verbose_name='Task Name'),
field=models.CharField(
db_index=True,
help_text='Name of the Task which was run',
max_length=getattr(
settings,
'DJANGO_CELERY_RESULTS_TASK_ID_MAX_LENGTH',
255
),
null=True,
verbose_name='Task Name'),
),
migrations.AlterField(
model_name='taskresult',
Expand Down
6 changes: 5 additions & 1 deletion django_celery_results/migrations/0009_groupresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ class Migration(migrations.Migration):
name='task_name',
field=models.CharField(
help_text='Name of the Task which was run',
max_length=255,
max_length=getattr(
settings,
'DJANGO_CELERY_RESULTS_TASK_ID_MAX_LENGTH',
255
),
null=True,
verbose_name='Task Name'),
),
Expand Down
6 changes: 5 additions & 1 deletion django_celery_results/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class TaskResult(models.Model):
verbose_name=_('Periodic Task Name'),
help_text=_('Name of the Periodic Task which was run'))
task_name = models.CharField(
null=True, max_length=255,
null=True, max_length=getattr(
settings,
'DJANGO_CELERY_RESULTS_TASK_ID_MAX_LENGTH',
255
),
verbose_name=_('Task Name'),
help_text=_('Name of the Task which was run'))
task_args = models.TextField(
Expand Down

0 comments on commit 6167179

Please sign in to comment.