diff --git a/apps/tasks/migrations/0013_alter_tasklog_expense_group.py b/apps/tasks/migrations/0013_alter_tasklog_expense_group.py new file mode 100644 index 00000000..b9f39c48 --- /dev/null +++ b/apps/tasks/migrations/0013_alter_tasklog_expense_group.py @@ -0,0 +1,20 @@ +# Generated by Django 3.2.14 on 2025-01-03 08:29 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('fyle', '0040_expense_masked_corporate_card_number'), + ('tasks', '0012_auto_20241127_0730'), + ] + + operations = [ + migrations.AlterField( + model_name='tasklog', + name='expense_group', + field=models.ForeignKey(help_text='Reference to Expense group', null=True, on_delete=django.db.models.deletion.PROTECT, to='fyle.expensegroup', unique=True), + ), + ] diff --git a/apps/tasks/models.py b/apps/tasks/models.py index 1af0b925..cc197169 100644 --- a/apps/tasks/models.py +++ b/apps/tasks/models.py @@ -20,7 +20,7 @@ class TaskLog(models.Model): workspace = models.ForeignKey(Workspace, on_delete=models.PROTECT, help_text='Reference to Workspace model') type = models.CharField(max_length=50, help_text='Task type (FETCH_EXPENSES / CREATE_BILL / CREATE_CHECK)') task_id = models.CharField(max_length=255, null=True, help_text='Django Q task reference') - expense_group = models.ForeignKey(ExpenseGroup, on_delete=models.PROTECT, null=True, help_text='Reference to Expense group') + expense_group = models.ForeignKey(ExpenseGroup, on_delete=models.PROTECT, null=True, help_text='Reference to Expense group', unique=True) bill = models.ForeignKey(Bill, on_delete=models.PROTECT, help_text='Reference to Bill', null=True) cheque = models.ForeignKey(Cheque, on_delete=models.PROTECT, help_text='Reference to Cheque', null=True) journal_entry = models.ForeignKey(JournalEntry, on_delete=models.PROTECT, help_text='Reference to journal_entry', null=True)