From 5f8c32f12462f43e860536b4ae6a1cfbf684df1e Mon Sep 17 00:00:00 2001 From: thenav56 Date: Fri, 12 May 2023 18:21:41 +0545 Subject: [PATCH] Django test migration update --- django/apps/existing_database/migrations/0001_initial.py | 5 +++++ django/apps/existing_database/models.py | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/django/apps/existing_database/migrations/0001_initial.py b/django/apps/existing_database/migrations/0001_initial.py index fa75e8f74..a8bfcd2fd 100644 --- a/django/apps/existing_database/migrations/0001_initial.py +++ b/django/apps/existing_database/migrations/0001_initial.py @@ -25,6 +25,11 @@ class Migration(migrations.Migration): ("required_count", models.IntegerField(blank=True, null=True)), ("progress", models.IntegerField(blank=True, null=True)), ("project_type_specifics", models.TextField(blank=True, null=True)), + ("total_area", models.FloatField(blank=True, null=True, default=None)), + ( + "time_spent_max_allowed", + models.FloatField(blank=True, null=True, default=None), + ), ], options={ "db_table": "groups", diff --git a/django/apps/existing_database/models.py b/django/apps/existing_database/models.py index fe6b00954..8aa8ea8a7 100644 --- a/django/apps/existing_database/models.py +++ b/django/apps/existing_database/models.py @@ -105,9 +105,10 @@ class Group(Model): required_count = models.IntegerField(blank=True, null=True) progress = models.IntegerField(blank=True, null=True) # Database uses JSON instead of JSONB (not supported by django) - project_type_specifics = models.TextField(blank=True, null=True) - total_area = models.FloatField(blank=True, null=True) - time_spent_max_allowed = models.FloatField(blank=True, null=True) + project_type_specifics = models.TextField(blank=True, null=True, default=None) + # Used by aggreagated module + total_area = models.FloatField(blank=True, null=True, default=None) + time_spent_max_allowed = models.FloatField(blank=True, null=True, default=None) # Django derived fields from ForeignKey project_id: str