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.

61 lines
2.4 KiB

  1. # Generated by Django 4.0.4 on 2022-06-29 06:19
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. import uuid
  6. class Migration(migrations.Migration):
  7. dependencies = [
  8. ("label_types", "0007_delete_relationtypeold"),
  9. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  10. ("examples", "0006_alter_example_upload_name"),
  11. ("labels", "0014_remove_uuid_null"),
  12. ]
  13. operations = [
  14. migrations.CreateModel(
  15. name="BoundingBox",
  16. fields=[
  17. ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
  18. ("uuid", models.UUIDField(default=uuid.uuid4, unique=True)),
  19. ("prob", models.FloatField(default=0.0)),
  20. ("manual", models.BooleanField(default=False)),
  21. ("created_at", models.DateTimeField(auto_now_add=True)),
  22. ("updated_at", models.DateTimeField(auto_now=True)),
  23. ("x", models.FloatField()),
  24. ("y", models.FloatField()),
  25. ("width", models.FloatField()),
  26. ("height", models.FloatField()),
  27. (
  28. "example",
  29. models.ForeignKey(
  30. on_delete=django.db.models.deletion.CASCADE, related_name="bboxes", to="examples.example"
  31. ),
  32. ),
  33. (
  34. "label",
  35. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="label_types.categorytype"),
  36. ),
  37. ("user", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  38. ],
  39. ),
  40. migrations.AddConstraint(
  41. model_name="boundingbox",
  42. constraint=models.CheckConstraint(check=models.Q(("x__gte", 0)), name="x >= 0"),
  43. ),
  44. migrations.AddConstraint(
  45. model_name="boundingbox",
  46. constraint=models.CheckConstraint(check=models.Q(("y__gte", 0)), name="y >= 0"),
  47. ),
  48. migrations.AddConstraint(
  49. model_name="boundingbox",
  50. constraint=models.CheckConstraint(check=models.Q(("width__gte", 0)), name="width >= 0"),
  51. ),
  52. migrations.AddConstraint(
  53. model_name="boundingbox",
  54. constraint=models.CheckConstraint(check=models.Q(("height__gte", 0)), name="height >= 0"),
  55. ),
  56. ]