0006_redo_partial_indexes.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # Generated by Django 1.11.1 on 2017-05-21 17:52
  2. import django.contrib.postgres.indexes
  3. from django.contrib.postgres.operations import BtreeGinExtension
  4. from django.db import migrations
  5. import misago.core.pgutils
  6. class Migration(migrations.Migration):
  7. dependencies = [("misago_threads", "0005_index_search_document")]
  8. operations = [
  9. migrations.AddIndex(
  10. model_name="post",
  11. index=misago.core.pgutils.PgPartialIndex(
  12. fields=["has_open_reports"],
  13. name="misago_thre_has_ope_479906_part",
  14. where={"has_open_reports": True},
  15. ),
  16. ),
  17. migrations.AddIndex(
  18. model_name="post",
  19. index=misago.core.pgutils.PgPartialIndex(
  20. fields=["is_hidden"],
  21. name="misago_thre_is_hidd_85db69_part",
  22. where={"is_hidden": False},
  23. ),
  24. ),
  25. migrations.AddIndex(
  26. model_name="thread",
  27. index=misago.core.pgutils.PgPartialIndex(
  28. fields=["weight"],
  29. name="misago_thre_weight_955884_part",
  30. where={"weight": 2},
  31. ),
  32. ),
  33. migrations.AddIndex(
  34. model_name="thread",
  35. index=misago.core.pgutils.PgPartialIndex(
  36. fields=["weight"],
  37. name="misago_thre_weight_9e8f9c_part",
  38. where={"weight": 1},
  39. ),
  40. ),
  41. migrations.AddIndex(
  42. model_name="thread",
  43. index=misago.core.pgutils.PgPartialIndex(
  44. fields=["weight"],
  45. name="misago_thre_weight_c7ef29_part",
  46. where={"weight": 0},
  47. ),
  48. ),
  49. migrations.AddIndex(
  50. model_name="thread",
  51. index=misago.core.pgutils.PgPartialIndex(
  52. fields=["weight"],
  53. name="misago_thre_weight__4af9ee_part",
  54. where={"weight__lt": 2},
  55. ),
  56. ),
  57. migrations.AddIndex(
  58. model_name="thread",
  59. index=misago.core.pgutils.PgPartialIndex(
  60. fields=["has_reported_posts"],
  61. name="misago_thre_has_rep_84acfa_part",
  62. where={"has_reported_posts": True},
  63. ),
  64. ),
  65. migrations.AddIndex(
  66. model_name="thread",
  67. index=misago.core.pgutils.PgPartialIndex(
  68. fields=["has_unapproved_posts"],
  69. name="misago_thre_has_una_b0dbf5_part",
  70. where={"has_unapproved_posts": True},
  71. ),
  72. ),
  73. migrations.AddIndex(
  74. model_name="thread",
  75. index=misago.core.pgutils.PgPartialIndex(
  76. fields=["is_hidden"],
  77. name="misago_thre_is_hidd_d2b96c_part",
  78. where={"is_hidden": False},
  79. ),
  80. ),
  81. ]