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.

198 lines
7.8 KiB

  1. # Generated by Django 3.2 on 2021-05-14 06:54
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  8. ('api', '0011_merge_0009_tag_0010_auto_20210413_0249'),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='Category',
  13. fields=[
  14. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('prob', models.FloatField(default=0.0)),
  16. ('manual', models.BooleanField(default=False)),
  17. ('created_at', models.DateTimeField(auto_now_add=True)),
  18. ('updated_at', models.DateTimeField(auto_now=True)),
  19. ],
  20. ),
  21. migrations.CreateModel(
  22. name='Example',
  23. fields=[
  24. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  25. ('meta', models.JSONField(default=dict)),
  26. ('filename', models.FileField(default='.', upload_to='')),
  27. ('text', models.TextField(blank=True, null=True)),
  28. ('created_at', models.DateTimeField(auto_now_add=True)),
  29. ('updated_at', models.DateTimeField(auto_now=True)),
  30. ('annotations_approved_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
  31. ],
  32. ),
  33. migrations.CreateModel(
  34. name='ImageClassificationProject',
  35. fields=[
  36. ('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.project')),
  37. ],
  38. options={
  39. 'abstract': False,
  40. 'base_manager_name': 'objects',
  41. },
  42. bases=('api.project',),
  43. ),
  44. migrations.CreateModel(
  45. name='Span',
  46. fields=[
  47. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  48. ('prob', models.FloatField(default=0.0)),
  49. ('manual', models.BooleanField(default=False)),
  50. ('created_at', models.DateTimeField(auto_now_add=True)),
  51. ('updated_at', models.DateTimeField(auto_now=True)),
  52. ('start_offset', models.IntegerField()),
  53. ('end_offset', models.IntegerField()),
  54. ('example', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='spans', to='api.example')),
  55. ('label', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.label')),
  56. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  57. ],
  58. options={
  59. 'unique_together': {('example', 'user', 'label', 'start_offset', 'end_offset')},
  60. },
  61. ),
  62. migrations.CreateModel(
  63. name='TextLabel',
  64. fields=[
  65. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  66. ('prob', models.FloatField(default=0.0)),
  67. ('manual', models.BooleanField(default=False)),
  68. ('created_at', models.DateTimeField(auto_now_add=True)),
  69. ('updated_at', models.DateTimeField(auto_now=True)),
  70. ('text', models.TextField()),
  71. ('example', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='texts', to='api.example')),
  72. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  73. ],
  74. options={
  75. 'unique_together': {('example', 'user', 'text')},
  76. },
  77. ),
  78. migrations.AlterUniqueTogether(
  79. name='documentannotation',
  80. unique_together=None,
  81. ),
  82. migrations.RemoveField(
  83. model_name='documentannotation',
  84. name='document',
  85. ),
  86. migrations.RemoveField(
  87. model_name='documentannotation',
  88. name='label',
  89. ),
  90. migrations.RemoveField(
  91. model_name='documentannotation',
  92. name='user',
  93. ),
  94. migrations.AlterUniqueTogether(
  95. name='seq2seqannotation',
  96. unique_together=None,
  97. ),
  98. migrations.RemoveField(
  99. model_name='seq2seqannotation',
  100. name='document',
  101. ),
  102. migrations.RemoveField(
  103. model_name='seq2seqannotation',
  104. name='user',
  105. ),
  106. migrations.AlterUniqueTogether(
  107. name='sequenceannotation',
  108. unique_together=None,
  109. ),
  110. migrations.RemoveField(
  111. model_name='sequenceannotation',
  112. name='document',
  113. ),
  114. migrations.RemoveField(
  115. model_name='sequenceannotation',
  116. name='label',
  117. ),
  118. migrations.RemoveField(
  119. model_name='sequenceannotation',
  120. name='user',
  121. ),
  122. migrations.AlterUniqueTogether(
  123. name='speech2textannotation',
  124. unique_together=None,
  125. ),
  126. migrations.RemoveField(
  127. model_name='speech2textannotation',
  128. name='document',
  129. ),
  130. migrations.RemoveField(
  131. model_name='speech2textannotation',
  132. name='user',
  133. ),
  134. migrations.RenameField(
  135. model_name='project',
  136. old_name='randomize_document_order',
  137. new_name='random_order',
  138. ),
  139. migrations.RemoveField(
  140. model_name='comment',
  141. name='document',
  142. ),
  143. migrations.AlterField(
  144. model_name='project',
  145. name='project_type',
  146. field=models.CharField(choices=[('DocumentClassification', 'document classification'), ('SequenceLabeling', 'sequence labeling'), ('Seq2seq', 'sequence to sequence'), ('Speech2text', 'speech to text'), ('ImageClassification', 'image classification')], max_length=30),
  147. ),
  148. migrations.DeleteModel(
  149. name='Document',
  150. ),
  151. migrations.DeleteModel(
  152. name='DocumentAnnotation',
  153. ),
  154. migrations.DeleteModel(
  155. name='Seq2seqAnnotation',
  156. ),
  157. migrations.DeleteModel(
  158. name='SequenceAnnotation',
  159. ),
  160. migrations.DeleteModel(
  161. name='Speech2textAnnotation',
  162. ),
  163. migrations.AddField(
  164. model_name='example',
  165. name='project',
  166. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='examples', to='api.project'),
  167. ),
  168. migrations.AddField(
  169. model_name='category',
  170. name='example',
  171. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categories', to='api.example'),
  172. ),
  173. migrations.AddField(
  174. model_name='category',
  175. name='label',
  176. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.label'),
  177. ),
  178. migrations.AddField(
  179. model_name='category',
  180. name='user',
  181. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
  182. ),
  183. migrations.AddField(
  184. model_name='comment',
  185. name='example',
  186. field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='api.example'),
  187. preserve_default=False,
  188. ),
  189. migrations.AlterUniqueTogether(
  190. name='category',
  191. unique_together={('example', 'user', 'label')},
  192. ),
  193. ]