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.

172 lines
8.5 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Generated by Django 2.1.7 on 2019-06-21 06:05
  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. initial = True
  7. dependencies = [
  8. ('contenttypes', '0002_remove_content_type_name'),
  9. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  10. ]
  11. operations = [
  12. migrations.CreateModel(
  13. name='Document',
  14. fields=[
  15. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  16. ('text', models.TextField()),
  17. ('meta', models.TextField(default='{}')),
  18. ('created_at', models.DateTimeField(auto_now_add=True)),
  19. ('updated_at', models.DateTimeField(auto_now=True)),
  20. ],
  21. ),
  22. migrations.CreateModel(
  23. name='DocumentAnnotation',
  24. fields=[
  25. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  26. ('prob', models.FloatField(default=0.0)),
  27. ('manual', models.BooleanField(default=False)),
  28. ('created_at', models.DateTimeField(auto_now_add=True)),
  29. ('updated_at', models.DateTimeField(auto_now=True)),
  30. ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='doc_annotations', to='api.Document')),
  31. ],
  32. ),
  33. migrations.CreateModel(
  34. name='Label',
  35. fields=[
  36. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  37. ('text', models.CharField(max_length=100)),
  38. ('prefix_key', models.CharField(blank=True, choices=[('ctrl', 'ctrl'), ('shift', 'shift'), ('ctrl shift', 'ctrl shift')], max_length=10, null=True)),
  39. ('suffix_key', models.CharField(blank=True, choices=[('a', 'a'), ('b', 'b'), ('c', 'c'), ('d', 'd'), ('e', 'e'), ('f', 'f'), ('g', 'g'), ('h', 'h'), ('i', 'i'), ('j', 'j'), ('k', 'k'), ('l', 'l'), ('m', 'm'), ('n', 'n'), ('o', 'o'), ('p', 'p'), ('q', 'q'), ('r', 'r'), ('s', 's'), ('t', 't'), ('u', 'u'), ('v', 'v'), ('w', 'w'), ('x', 'x'), ('y', 'y'), ('z', 'z')], max_length=1, null=True)),
  40. ('background_color', models.CharField(default='#209cee', max_length=7)),
  41. ('text_color', models.CharField(default='#ffffff', max_length=7)),
  42. ('created_at', models.DateTimeField(auto_now_add=True)),
  43. ('updated_at', models.DateTimeField(auto_now=True)),
  44. ],
  45. ),
  46. migrations.CreateModel(
  47. name='Project',
  48. fields=[
  49. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  50. ('name', models.CharField(max_length=100)),
  51. ('description', models.TextField(default='')),
  52. ('guideline', models.TextField(default='')),
  53. ('created_at', models.DateTimeField(auto_now_add=True)),
  54. ('updated_at', models.DateTimeField(auto_now=True)),
  55. ('project_type', models.CharField(choices=[('DocumentClassification', 'document classification'), ('SequenceLabeling', 'sequence labeling'), ('Seq2seq', 'sequence to sequence')], max_length=30)),
  56. ('randomize_document_order', models.BooleanField(default=False)),
  57. ],
  58. options={
  59. 'abstract': False,
  60. 'base_manager_name': 'objects',
  61. },
  62. ),
  63. migrations.CreateModel(
  64. name='Seq2seqAnnotation',
  65. fields=[
  66. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  67. ('prob', models.FloatField(default=0.0)),
  68. ('manual', models.BooleanField(default=False)),
  69. ('created_at', models.DateTimeField(auto_now_add=True)),
  70. ('updated_at', models.DateTimeField(auto_now=True)),
  71. ('text', models.TextField()),
  72. ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seq2seq_annotations', to='api.Document')),
  73. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  74. ],
  75. ),
  76. migrations.CreateModel(
  77. name='SequenceAnnotation',
  78. fields=[
  79. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  80. ('prob', models.FloatField(default=0.0)),
  81. ('manual', models.BooleanField(default=False)),
  82. ('created_at', models.DateTimeField(auto_now_add=True)),
  83. ('updated_at', models.DateTimeField(auto_now=True)),
  84. ('start_offset', models.IntegerField()),
  85. ('end_offset', models.IntegerField()),
  86. ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seq_annotations', to='api.Document')),
  87. ('label', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Label')),
  88. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  89. ],
  90. ),
  91. migrations.CreateModel(
  92. name='Seq2seqProject',
  93. fields=[
  94. ('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')),
  95. ],
  96. options={
  97. 'abstract': False,
  98. 'base_manager_name': 'objects',
  99. },
  100. bases=('api.project',),
  101. ),
  102. migrations.CreateModel(
  103. name='SequenceLabelingProject',
  104. fields=[
  105. ('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')),
  106. ],
  107. options={
  108. 'abstract': False,
  109. 'base_manager_name': 'objects',
  110. },
  111. bases=('api.project',),
  112. ),
  113. migrations.CreateModel(
  114. name='TextClassificationProject',
  115. fields=[
  116. ('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')),
  117. ],
  118. options={
  119. 'abstract': False,
  120. 'base_manager_name': 'objects',
  121. },
  122. bases=('api.project',),
  123. ),
  124. migrations.AddField(
  125. model_name='project',
  126. name='polymorphic_ctype',
  127. field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_api.project_set+', to='contenttypes.ContentType'),
  128. ),
  129. migrations.AddField(
  130. model_name='project',
  131. name='users',
  132. field=models.ManyToManyField(related_name='projects', to=settings.AUTH_USER_MODEL),
  133. ),
  134. migrations.AddField(
  135. model_name='label',
  136. name='project',
  137. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='labels', to='api.Project'),
  138. ),
  139. migrations.AddField(
  140. model_name='documentannotation',
  141. name='label',
  142. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Label'),
  143. ),
  144. migrations.AddField(
  145. model_name='documentannotation',
  146. name='user',
  147. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
  148. ),
  149. migrations.AddField(
  150. model_name='document',
  151. name='project',
  152. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='api.Project'),
  153. ),
  154. migrations.AlterUniqueTogether(
  155. name='sequenceannotation',
  156. unique_together={('document', 'user', 'label', 'start_offset', 'end_offset')},
  157. ),
  158. migrations.AlterUniqueTogether(
  159. name='label',
  160. unique_together={('project', 'text'), ('project', 'prefix_key', 'suffix_key')},
  161. ),
  162. migrations.AlterUniqueTogether(
  163. name='documentannotation',
  164. unique_together={('document', 'user', 'label')},
  165. ),
  166. ]