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.

48 lines
1.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
  1. # Generated by Django 3.1.6 on 2021-03-02 10:13
  2. import django.db.models.deletion
  3. from django.conf import settings
  4. from django.db import migrations, models
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. ("api", "0008_auto_20210302_1013"),
  8. ]
  9. operations = [
  10. migrations.CreateModel( # id_autogen, annotation_id_1, annotation_id_2, type, author, timestamp
  11. name="RelationTypes",
  12. fields=[
  13. ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
  14. ("name", models.TextField(max_length=50)),
  15. ("color", models.TextField(max_length=20)),
  16. (
  17. "project",
  18. models.ForeignKey(
  19. on_delete=django.db.models.deletion.CASCADE, related_name="relation_types", to="api.Project"
  20. ),
  21. ),
  22. ],
  23. ),
  24. migrations.CreateModel( # id_autogen, annotation_id_1, annotation_id_2, type, author, timestamp
  25. name="AnnotationRelations",
  26. fields=[
  27. ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
  28. ("annotation_id_1", models.IntegerField()),
  29. ("annotation_id_2", models.IntegerField()),
  30. ("type", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="api.RelationTypes")),
  31. ("user", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  32. ("timestamp", models.DateTimeField(auto_now_add=True)),
  33. (
  34. "project",
  35. models.ForeignKey(
  36. on_delete=django.db.models.deletion.CASCADE,
  37. related_name="annotation_relations",
  38. to="api.Project",
  39. ),
  40. ),
  41. ],
  42. ),
  43. ]