0001_initial.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Generated by Django 3.2.5 on 2021-07-18 10:57
  2. import ckeditor.fields
  3. from django.conf import settings
  4. from django.db import migrations, models
  5. import django.db.models.deletion
  6. import django.utils.timezone
  7. import mptt.fields
  8. class Migration(migrations.Migration):
  9. initial = True
  10. dependencies = [
  11. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  12. ('article', '0001_initial'),
  13. ]
  14. operations = [
  15. migrations.CreateModel(
  16. name='Comment',
  17. fields=[
  18. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  19. ('body', ckeditor.fields.RichTextField()),
  20. ('created', models.DateTimeField(default=django.utils.timezone.now)),
  21. ('updated', models.DateTimeField(default=django.utils.timezone.now)),
  22. ('total_views', models.PositiveIntegerField(default=0)),
  23. ('lft', models.PositiveIntegerField(editable=False)),
  24. ('rght', models.PositiveIntegerField(editable=False)),
  25. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  26. ('level', models.PositiveIntegerField(editable=False)),
  27. ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment', to='article.articlepost')),
  28. ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='comment.comment')),
  29. ('reply_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replyers', to=settings.AUTH_USER_MODEL)),
  30. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment', to=settings.AUTH_USER_MODEL)),
  31. ],
  32. options={
  33. 'abstract': False,
  34. },
  35. ),
  36. ]