From d52e1d5d0cdf26a66ff417e1387d308ae77ee0ec Mon Sep 17 00:00:00 2001 From: Galen Date: Mon, 12 Aug 2024 12:17:26 -0700 Subject: [PATCH] make search_component.componentpath nullable in postgres to indicate backend only, re #10804 --- arches/app/models/migrations/10804_core_search_filters.py | 7 +++++++ arches/app/models/models.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arches/app/models/migrations/10804_core_search_filters.py b/arches/app/models/migrations/10804_core_search_filters.py index 9e02db02418..abbdfce4404 100644 --- a/arches/app/models/migrations/10804_core_search_filters.py +++ b/arches/app/models/migrations/10804_core_search_filters.py @@ -45,6 +45,7 @@ class Migration(migrations.Migration): UPDATE search_component SET config = '{"layoutType":"popup"}' where componentname = 'saved-searches'; UPDATE search_component SET config = '{"layoutType":"popup"}' where componentname = 'search-export'; UPDATE search_component SET type = 'term-filter' where componentname = 'term-filter'; + UPDATE search_component SET componentpath = null where componentpath = ''; """ reverse_sql = """ @@ -53,9 +54,15 @@ class Migration(migrations.Migration): UPDATE search_component SET type = 'filter', sortorder = 1 where componentname = 'map-filter'; UPDATE search_component SET type = 'results-list' where componentname = 'search-results'; UPDATE search_component SET type = 'text-input' where componentname = 'term-filter'; + UPDATE search_component SET componentpath = '' where componentpath is null; """ operations = [ + migrations.AlterField( + model_name="searchcomponent", + name="componentpath", + field=models.TextField(null=True, unique=True), + ), migrations.AddField( model_name="searchcomponent", name="config", diff --git a/arches/app/models/models.py b/arches/app/models/models.py index 5464a16f4c6..53c0c726457 100644 --- a/arches/app/models/models.py +++ b/arches/app/models/models.py @@ -1201,7 +1201,7 @@ class SearchComponent(models.Model): modulename = models.TextField(blank=True, null=True) classname = models.TextField(blank=True, null=True) type = models.TextField() - componentpath = models.TextField(unique=True) + componentpath = models.TextField(unique=True, null=True) componentname = models.TextField(unique=True) config = models.JSONField(default=dict)