Refactor content status terminology and enhance cluster serializers with idea and content counts
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def migrate_content_status_forward(apps, schema_editor):
|
||||
Content = apps.get_model('writer', 'Content')
|
||||
Content.objects.filter(status='published').update(status='publish')
|
||||
|
||||
|
||||
def migrate_content_status_backward(apps, schema_editor):
|
||||
Content = apps.get_model('writer', 'Content')
|
||||
Content.objects.filter(status='publish').update(status='published')
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('writer', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='tasks',
|
||||
name='status',
|
||||
field=models.CharField(
|
||||
choices=[('queued', 'Queued'), ('completed', 'Completed')],
|
||||
default='queued',
|
||||
max_length=50,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='content',
|
||||
name='status',
|
||||
field=models.CharField(
|
||||
choices=[('draft', 'Draft'), ('review', 'Review'), ('publish', 'Publish')],
|
||||
default='draft',
|
||||
help_text='Content workflow status (draft, review, publish)',
|
||||
max_length=50,
|
||||
),
|
||||
),
|
||||
migrations.RunPython(
|
||||
migrate_content_status_forward,
|
||||
migrate_content_status_backward,
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user