From 9ae3a25babce051af085916fa6d781b3a9ca0892 Mon Sep 17 00:00:00 2001 From: isabelmeister Date: Wed, 13 Nov 2024 22:18:45 -0300 Subject: [PATCH 1/3] feat: create migration --- .../0051_add_dataset_new_urlfield.py | 18 ------------------ .../migrations/0051_add_new_field_dataset.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 18 deletions(-) delete mode 100644 backend/apps/api/v1/migrations/0051_add_dataset_new_urlfield.py create mode 100644 backend/apps/api/v1/migrations/0051_add_new_field_dataset.py diff --git a/backend/apps/api/v1/migrations/0051_add_dataset_new_urlfield.py b/backend/apps/api/v1/migrations/0051_add_dataset_new_urlfield.py deleted file mode 100644 index e303c87b..00000000 --- a/backend/apps/api/v1/migrations/0051_add_dataset_new_urlfield.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.16 on 2024-11-13 01:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('v1', '0050_table_is_deprecated'), - ] - - operations = [ - migrations.AddField( - model_name='dataset', - name='link_url', - field=models.URLField(blank=True, null=True, verbose_name='Link') - ), - ] diff --git a/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py b/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py new file mode 100644 index 00000000..615c5de6 --- /dev/null +++ b/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py @@ -0,0 +1,13 @@ +# Generated by Django 4.2.16 on 2024-11-13 16:59 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('v1', '0050_table_is_deprecated'), + ] + + operations = [ + ] From 6ab2f6c300c91a543aa0102c16241b480c681c29 Mon Sep 17 00:00:00 2001 From: isabelmeister Date: Wed, 13 Nov 2024 22:20:31 -0300 Subject: [PATCH 2/3] fix: change link field type and constraints in Dataset --- .../apps/api/v1/migrations/0051_add_new_field_dataset.py | 8 +++++++- backend/apps/api/v1/models.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py b/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py index 615c5de6..cb0dca8d 100644 --- a/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py +++ b/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py @@ -1,6 +1,6 @@ # Generated by Django 4.2.16 on 2024-11-13 16:59 -from django.db import migrations +from django.db import migrations, models class Migration(migrations.Migration): @@ -10,4 +10,10 @@ class Migration(migrations.Migration): ] operations = [ + migrations.AddField( + model_name='dataset', + name='link', + field=models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Link') + ), ] + diff --git a/backend/apps/api/v1/models.py b/backend/apps/api/v1/models.py index 2ab0d83b..e382e832 100644 --- a/backend/apps/api/v1/models.py +++ b/backend/apps/api/v1/models.py @@ -545,7 +545,7 @@ class Dataset(BaseModel): default=0, help_text="Number of page views by Google Analytics", ) - link_url = models.URLField(blank=True, null=True, verbose_name='Link') + link_url = models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Link') graphql_nested_filter_fields_whitelist = ["id", "slug"] From 2f14a925f47817ecd99811701c199fd49c6d7756 Mon Sep 17 00:00:00 2001 From: isabelmeister Date: Thu, 14 Nov 2024 10:27:40 -0300 Subject: [PATCH 3/3] fix: change field name --- backend/apps/api/v1/migrations/0051_add_new_field_dataset.py | 4 ++-- backend/apps/api/v1/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py b/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py index cb0dca8d..0fcd2b45 100644 --- a/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py +++ b/backend/apps/api/v1/migrations/0051_add_new_field_dataset.py @@ -12,8 +12,8 @@ class Migration(migrations.Migration): operations = [ migrations.AddField( model_name='dataset', - name='link', - field=models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Link') + name='usage_guide', + field=models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Guia de Uso') ), ] diff --git a/backend/apps/api/v1/models.py b/backend/apps/api/v1/models.py index e382e832..53cb249f 100644 --- a/backend/apps/api/v1/models.py +++ b/backend/apps/api/v1/models.py @@ -545,7 +545,7 @@ class Dataset(BaseModel): default=0, help_text="Number of page views by Google Analytics", ) - link_url = models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Link') + usage_guide = models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Guia de Uso') graphql_nested_filter_fields_whitelist = ["id", "slug"]