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.

79 lines
3.7 KiB

  1. # Generated by Django 3.2.11 on 2022-01-28 02:46
  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. 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. ('id',
  19. models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  20. ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True)),
  21. ('meta', models.JSONField(default=dict)),
  22. ('filename', models.FileField(default='.', max_length=1024, upload_to='')),
  23. ('text', models.TextField(blank=True, null=True)),
  24. ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
  25. ('updated_at', models.DateTimeField(auto_now=True)),
  26. ('annotations_approved_by',
  27. models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL,
  28. to=settings.AUTH_USER_MODEL)),
  29. ('project',
  30. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='examples',
  31. to='api.project')),
  32. ],
  33. options={
  34. 'ordering': ['created_at'],
  35. },
  36. ),
  37. migrations.CreateModel(
  38. name='Comment',
  39. fields=[
  40. ('id',
  41. models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  42. ('text', models.TextField()),
  43. ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
  44. ('updated_at', models.DateTimeField(auto_now=True)),
  45. ('example',
  46. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments',
  47. to='examples.example')),
  48. ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE,
  49. to=settings.AUTH_USER_MODEL)),
  50. ],
  51. options={
  52. 'ordering': ['created_at'],
  53. },
  54. ),
  55. migrations.CreateModel(
  56. name='ExampleState',
  57. fields=[
  58. ('id',
  59. models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  60. ('confirmed_at', models.DateTimeField(auto_now=True)),
  61. ('confirmed_by',
  62. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  63. ('example',
  64. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='states',
  65. to='examples.example')),
  66. ],
  67. options={
  68. 'unique_together': {('example', 'confirmed_by')},
  69. },
  70. ),
  71. ]
  72. )
  73. ]