mirror of
https://github.com/Eugeny/tabby-web.git
synced 2025-06-08 13:39:56 +00:00
29 lines
748 B
Python
29 lines
748 B
Python
from django.db import migrations, models
|
|
|
|
|
|
def run_forward(apps, schema_editor):
|
|
for config in apps.get_model('app', 'Config').objects.all():
|
|
config.name = f'Unnamed config ({config.created_at.date()})'
|
|
config.save()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('app', '0005_user_force_pro'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='config',
|
|
name='name',
|
|
field=models.CharField(max_length=255, null=True),
|
|
),
|
|
migrations.RunPython(run_forward, lambda _, __: None),
|
|
migrations.AlterField(
|
|
model_name='config',
|
|
name='name',
|
|
field=models.CharField(max_length=255),
|
|
),
|
|
]
|