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.

117 lines
4.7 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
  1. # Generated by Django 3.2.11 on 2022-01-28 02:46
  2. import uuid
  3. import django.db.models.deletion
  4. from django.conf import settings
  5. from django.db import migrations, models
  6. class Migration(migrations.Migration):
  7. initial = True
  8. dependencies = [
  9. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  10. ("api", "0034_auto_20220128_0246"),
  11. ]
  12. operations = [
  13. migrations.SeparateDatabaseAndState(
  14. state_operations=[
  15. migrations.CreateModel(
  16. name="Example",
  17. fields=[
  18. (
  19. "id",
  20. models.BigAutoField(
  21. auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
  22. ),
  23. ),
  24. ("uuid", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True)),
  25. ("meta", models.JSONField(default=dict)),
  26. ("filename", models.FileField(default=".", max_length=1024, upload_to="")),
  27. ("text", models.TextField(blank=True, null=True)),
  28. ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
  29. ("updated_at", models.DateTimeField(auto_now=True)),
  30. (
  31. "annotations_approved_by",
  32. models.ForeignKey(
  33. blank=True,
  34. null=True,
  35. on_delete=django.db.models.deletion.SET_NULL,
  36. to=settings.AUTH_USER_MODEL,
  37. ),
  38. ),
  39. (
  40. "project",
  41. models.ForeignKey(
  42. on_delete=django.db.models.deletion.CASCADE, related_name="examples", to="api.project"
  43. ),
  44. ),
  45. ],
  46. options={
  47. "ordering": ["created_at"],
  48. },
  49. ),
  50. migrations.CreateModel(
  51. name="Comment",
  52. fields=[
  53. (
  54. "id",
  55. models.BigAutoField(
  56. auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
  57. ),
  58. ),
  59. ("text", models.TextField()),
  60. ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
  61. ("updated_at", models.DateTimeField(auto_now=True)),
  62. (
  63. "example",
  64. models.ForeignKey(
  65. on_delete=django.db.models.deletion.CASCADE,
  66. related_name="comments",
  67. to="examples.example",
  68. ),
  69. ),
  70. (
  71. "user",
  72. models.ForeignKey(
  73. null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
  74. ),
  75. ),
  76. ],
  77. options={
  78. "ordering": ["created_at"],
  79. },
  80. ),
  81. migrations.CreateModel(
  82. name="ExampleState",
  83. fields=[
  84. (
  85. "id",
  86. models.BigAutoField(
  87. auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
  88. ),
  89. ),
  90. ("confirmed_at", models.DateTimeField(auto_now=True)),
  91. (
  92. "confirmed_by",
  93. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
  94. ),
  95. (
  96. "example",
  97. models.ForeignKey(
  98. on_delete=django.db.models.deletion.CASCADE,
  99. related_name="states",
  100. to="examples.example",
  101. ),
  102. ),
  103. ],
  104. options={
  105. "unique_together": {("example", "confirmed_by")},
  106. },
  107. ),
  108. ]
  109. )
  110. ]