0012_set_dj_partial_indexes.py 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Generated by Django 2.2.1 on 2019-05-18 16:59
  2. from django.db import migrations, models
  3. class Migration(migrations.Migration):
  4. dependencies = [("misago_threads", "0011_remove_custom_partial_indexes")]
  5. operations = [
  6. migrations.AddIndex(
  7. model_name="post",
  8. index=models.Index(
  9. condition=models.Q(has_open_reports=True),
  10. fields=["has_open_reports"],
  11. name="misago_post_has_open_repo_part",
  12. ),
  13. ),
  14. migrations.AddIndex(
  15. model_name="post",
  16. index=models.Index(
  17. condition=models.Q(is_hidden=False),
  18. fields=["is_hidden"],
  19. name="misago_post_is_hidden_part",
  20. ),
  21. ),
  22. migrations.AddIndex(
  23. model_name="post",
  24. index=models.Index(
  25. condition=models.Q(is_event=True),
  26. fields=["is_event", "event_type"],
  27. name="misago_post_is_event_part",
  28. ),
  29. ),
  30. migrations.AddIndex(
  31. model_name="thread",
  32. index=models.Index(
  33. condition=models.Q(weight=2),
  34. fields=["weight"],
  35. name="misago_thread_pinned_glob_part",
  36. ),
  37. ),
  38. migrations.AddIndex(
  39. model_name="thread",
  40. index=models.Index(
  41. condition=models.Q(weight=1),
  42. fields=["weight"],
  43. name="misago_thread_pinned_loca_part",
  44. ),
  45. ),
  46. migrations.AddIndex(
  47. model_name="thread",
  48. index=models.Index(
  49. condition=models.Q(weight=0),
  50. fields=["weight"],
  51. name="misago_thread_not_pinned_part",
  52. ),
  53. ),
  54. migrations.AddIndex(
  55. model_name="thread",
  56. index=models.Index(
  57. condition=models.Q(weight__lt=2),
  58. fields=["weight"],
  59. name="misago_thread_not_global_part",
  60. ),
  61. ),
  62. migrations.AddIndex(
  63. model_name="thread",
  64. index=models.Index(
  65. condition=models.Q(has_reported_posts=True),
  66. fields=["has_reported_posts"],
  67. name="misago_thread_has_reporte_part",
  68. ),
  69. ),
  70. migrations.AddIndex(
  71. model_name="thread",
  72. index=models.Index(
  73. condition=models.Q(has_unapproved_posts=True),
  74. fields=["has_unapproved_posts"],
  75. name="misago_thread_has_unappro_part",
  76. ),
  77. ),
  78. migrations.AddIndex(
  79. model_name="thread",
  80. index=models.Index(
  81. condition=models.Q(is_hidden=False),
  82. fields=["is_hidden"],
  83. name="misago_thread_is_visible_part",
  84. ),
  85. ),
  86. ]