[WEB-3957] chore: IntakeIssues with iexact 'in-app' changed to 'IN_APP' (#6977)

* migration: data with iexact 'in-app' changed to 'IN_APP'

* chore: add start_of_week field in profile

* chore: define variables for choices

* chore: merge migration files
This commit is contained in:
Sangeetha
2025-04-29 15:22:42 +05:30
committed by GitHub
parent efa64fc4b8
commit 55340f9f48
2 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# Generated by Django 4.2.17 on 2025-04-25 09:02
from django.db import migrations, models
from plane.db.models.intake import SourceType
def set_default_source_type(apps, schema_editor):
IntakeIssue = apps.get_model("db", "IntakeIssue")
IntakeIssue.objects.filter(source__iexact="in-app").update(source=SourceType.IN_APP)
class Migration(migrations.Migration):
dependencies = [
('db', '0093_page_moved_to_page_page_moved_to_project_and_more'),
]
operations = [
migrations.RunPython(
set_default_source_type,
migrations.RunPython.noop,
),
migrations.AddField(
model_name='profile',
name='start_of_the_week',
field=models.PositiveSmallIntegerField(choices=[(0, 'Sunday'), (1, 'Monday'), (2, 'Tuesday'), (3, 'Wednesday'), (4, 'Thursday'), (5, 'Friday'), (6, 'Saturday')], default=0),
),
]

View File

@@ -164,6 +164,24 @@ class User(AbstractBaseUser, PermissionsMixin):
class Profile(TimeAuditModel):
SUNDAY = 0
MONDAY = 1
TUESDAY = 2
WEDNESDAY = 3
THURSDAY = 4
FRIDAY = 5
SATURDAY = 6
START_OF_THE_WEEK_CHOICES = (
(SUNDAY, "Sunday"),
(MONDAY, "Monday"),
(TUESDAY, "Tuesday"),
(WEDNESDAY, "Wednesday"),
(THURSDAY, "Thursday"),
(FRIDAY, "Friday"),
(SATURDAY, "Saturday"),
)
id = models.UUIDField(
default=uuid.uuid4, unique=True, editable=False, db_index=True, primary_key=True
)
@@ -194,6 +212,9 @@ class Profile(TimeAuditModel):
mobile_timezone_auto_set = models.BooleanField(default=False)
# language
language = models.CharField(max_length=255, default="en")
start_of_the_week = models.PositiveSmallIntegerField(
choices=START_OF_THE_WEEK_CHOICES, default=SUNDAY
)
class Meta:
verbose_name = "Profile"