* migration: added version field in webhook * chore: add max_length * chore: added product tour fields * chore: updated the migration file * chore: removed the duplicated migration file * chore: added allowed_rate_limit for api_tokens * chore: changed key feature tour to product tour * chore: added is_subscribed_to_changelog field --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
57 lines
1.7 KiB
Python
57 lines
1.7 KiB
Python
# Generated by Django 4.2.26 on 2025-12-15 10:29
|
|
|
|
from django.db import migrations, models
|
|
import plane.db.models.workspace
|
|
|
|
|
|
def get_default_product_tour():
|
|
return {
|
|
"work_items": True,
|
|
"cycles": True,
|
|
"modules": True,
|
|
"intake": True,
|
|
"pages": True,
|
|
}
|
|
|
|
|
|
def populate_product_tour(apps, _schema_editor):
|
|
WorkspaceUserProperties = apps.get_model('db', 'WorkspaceUserProperties')
|
|
default_value = get_default_product_tour()
|
|
# Use bulk update for better performance
|
|
WorkspaceUserProperties.objects.all().update(product_tour=default_value)
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('db', '0112_auto_20251124_0603'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='webhook',
|
|
name='version',
|
|
field=models.CharField(default='v1', max_length=50),
|
|
),
|
|
migrations.AddField(
|
|
model_name='profile',
|
|
name='is_navigation_tour_completed',
|
|
field=models.BooleanField(default=False),
|
|
),
|
|
migrations.AddField(
|
|
model_name='workspaceuserproperties',
|
|
name='product_tour',
|
|
field=models.JSONField(default=plane.db.models.workspace.get_default_product_tour),
|
|
),
|
|
migrations.AddField(
|
|
model_name='apitoken',
|
|
name='allowed_rate_limit',
|
|
field=models.CharField(default='60/min', max_length=255),
|
|
),
|
|
migrations.AddField(
|
|
model_name='profile',
|
|
name='is_subscribed_to_changelog',
|
|
field=models.BooleanField(default=False),
|
|
),
|
|
migrations.RunPython(populate_product_tour, reverse_code=migrations.RunPython.noop),
|
|
]
|