You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 lines
6.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # Generated by Django 3.2.8 on 2021-12-21 14:15
  2. import django.db.models.deletion
  3. from django.db import migrations, models
  4. from label_types.models import generate_random_hex_color
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. ("api", "0019_auto_20211124_0506"),
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name="CategoryType",
  12. fields=[
  13. ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
  14. ("text", models.CharField(db_index=True, max_length=100)),
  15. (
  16. "prefix_key",
  17. models.CharField(
  18. blank=True,
  19. choices=[("ctrl", "ctrl"), ("shift", "shift"), ("ctrl shift", "ctrl shift")],
  20. max_length=10,
  21. null=True,
  22. ),
  23. ),
  24. (
  25. "suffix_key",
  26. models.CharField(
  27. blank=True,
  28. choices=[
  29. ("0", "0"),
  30. ("1", "1"),
  31. ("2", "2"),
  32. ("3", "3"),
  33. ("4", "4"),
  34. ("5", "5"),
  35. ("6", "6"),
  36. ("7", "7"),
  37. ("8", "8"),
  38. ("9", "9"),
  39. ("a", "a"),
  40. ("b", "b"),
  41. ("c", "c"),
  42. ("d", "d"),
  43. ("e", "e"),
  44. ("f", "f"),
  45. ("g", "g"),
  46. ("h", "h"),
  47. ("i", "i"),
  48. ("j", "j"),
  49. ("k", "k"),
  50. ("l", "l"),
  51. ("m", "m"),
  52. ("n", "n"),
  53. ("o", "o"),
  54. ("p", "p"),
  55. ("q", "q"),
  56. ("r", "r"),
  57. ("s", "s"),
  58. ("t", "t"),
  59. ("u", "u"),
  60. ("v", "v"),
  61. ("w", "w"),
  62. ("x", "x"),
  63. ("y", "y"),
  64. ("z", "z"),
  65. ],
  66. max_length=1,
  67. null=True,
  68. ),
  69. ),
  70. ("background_color", models.CharField(default=generate_random_hex_color, max_length=7)),
  71. ("text_color", models.CharField(default="#ffffff", max_length=7)),
  72. ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
  73. ("updated_at", models.DateTimeField(auto_now=True)),
  74. ],
  75. options={
  76. "ordering": ["created_at"],
  77. "abstract": False,
  78. },
  79. ),
  80. migrations.CreateModel(
  81. name="SpanType",
  82. fields=[
  83. ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
  84. ("text", models.CharField(db_index=True, max_length=100)),
  85. (
  86. "prefix_key",
  87. models.CharField(
  88. blank=True,
  89. choices=[("ctrl", "ctrl"), ("shift", "shift"), ("ctrl shift", "ctrl shift")],
  90. max_length=10,
  91. null=True,
  92. ),
  93. ),
  94. (
  95. "suffix_key",
  96. models.CharField(
  97. blank=True,
  98. choices=[
  99. ("0", "0"),
  100. ("1", "1"),
  101. ("2", "2"),
  102. ("3", "3"),
  103. ("4", "4"),
  104. ("5", "5"),
  105. ("6", "6"),
  106. ("7", "7"),
  107. ("8", "8"),
  108. ("9", "9"),
  109. ("a", "a"),
  110. ("b", "b"),
  111. ("c", "c"),
  112. ("d", "d"),
  113. ("e", "e"),
  114. ("f", "f"),
  115. ("g", "g"),
  116. ("h", "h"),
  117. ("i", "i"),
  118. ("j", "j"),
  119. ("k", "k"),
  120. ("l", "l"),
  121. ("m", "m"),
  122. ("n", "n"),
  123. ("o", "o"),
  124. ("p", "p"),
  125. ("q", "q"),
  126. ("r", "r"),
  127. ("s", "s"),
  128. ("t", "t"),
  129. ("u", "u"),
  130. ("v", "v"),
  131. ("w", "w"),
  132. ("x", "x"),
  133. ("y", "y"),
  134. ("z", "z"),
  135. ],
  136. max_length=1,
  137. null=True,
  138. ),
  139. ),
  140. ("background_color", models.CharField(default=generate_random_hex_color, max_length=7)),
  141. ("text_color", models.CharField(default="#ffffff", max_length=7)),
  142. ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
  143. ("updated_at", models.DateTimeField(auto_now=True)),
  144. ],
  145. options={
  146. "ordering": ["created_at"],
  147. "abstract": False,
  148. },
  149. ),
  150. migrations.AlterUniqueTogether(
  151. name="label",
  152. unique_together=set(),
  153. ),
  154. migrations.AddConstraint(
  155. model_name="label",
  156. constraint=models.UniqueConstraint(fields=("project", "text"), name="api_label_is_unique"),
  157. ),
  158. migrations.AddField(
  159. model_name="spantype",
  160. name="project",
  161. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="api.project"),
  162. ),
  163. migrations.AddField(
  164. model_name="categorytype",
  165. name="project",
  166. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="api.project"),
  167. ),
  168. migrations.AddConstraint(
  169. model_name="spantype",
  170. constraint=models.UniqueConstraint(fields=("project", "text"), name="api_spantype_is_unique"),
  171. ),
  172. migrations.AddConstraint(
  173. model_name="categorytype",
  174. constraint=models.UniqueConstraint(fields=("project", "text"), name="api_categorytype_is_unique"),
  175. ),
  176. ]