Skip to content

Commit

Permalink
make search_component.componentpath nullable in postgres to indicate …
Browse files Browse the repository at this point in the history
…backend only, re #10804
  • Loading branch information
whatisgalen committed Aug 12, 2024
1 parent da76681 commit d52e1d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions arches/app/models/migrations/10804_core_search_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion arches/app/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit d52e1d5

Please sign in to comment.