[WEB-5350] migration: navigation (#8156)

* migration: navigation related fields in workspace_user_properties

* fix: field names

* fix: remove max_length

* fix: create new migration

* fix: typo

* Renamed horizontal preference to tabbed

---------

Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
This commit is contained in:
Sangeetha 2025-11-21 20:51:47 +05:30 committed by GitHub
parent 0f4309659a
commit ba4e711f9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# Generated by Django 4.2.26 on 2025-11-21 11:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0109_issuecomment_description_and_parent_id'),
]
operations = [
migrations.AddField(
model_name='workspaceuserproperties',
name='navigation_control_preference',
field=models.CharField(choices=[('ACCORDION', 'Accordion'), ('TABBED', 'Tabbed')], default='ACCORDION', max_length=25),
),
migrations.AddField(
model_name='workspaceuserproperties',
name='navigation_project_limit',
field=models.IntegerField(default=10),
),
]

View file

@ -301,6 +301,10 @@ class WorkspaceTheme(BaseModel):
class WorkspaceUserProperties(BaseModel): class WorkspaceUserProperties(BaseModel):
class NavigationControlPreference(models.TextChoices):
ACCORDION = "ACCORDION", "Accordion"
TABBED = "TABBED", "Tabbed"
workspace = models.ForeignKey( workspace = models.ForeignKey(
"db.Workspace", "db.Workspace",
on_delete=models.CASCADE, on_delete=models.CASCADE,
@ -315,6 +319,12 @@ class WorkspaceUserProperties(BaseModel):
display_filters = models.JSONField(default=get_default_display_filters) display_filters = models.JSONField(default=get_default_display_filters)
display_properties = models.JSONField(default=get_default_display_properties) display_properties = models.JSONField(default=get_default_display_properties)
rich_filters = models.JSONField(default=dict) rich_filters = models.JSONField(default=dict)
navigation_project_limit = models.IntegerField(default=10)
navigation_control_preference = models.CharField(
max_length=25,
choices=NavigationControlPreference.choices,
default=NavigationControlPreference.ACCORDION,
)
class Meta: class Meta:
unique_together = ["workspace", "user", "deleted_at"] unique_together = ["workspace", "user", "deleted_at"]