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.

175 lines
8.6 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
  1. # Generated by Django 2.1.7 on 2019-03-31 12:43
  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='server.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. ],
  57. options={
  58. 'abstract': False,
  59. 'base_manager_name': 'objects',
  60. },
  61. ),
  62. migrations.CreateModel(
  63. name='Seq2seqAnnotation',
  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. ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seq2seq_annotations', to='server.Document')),
  72. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  73. ],
  74. ),
  75. migrations.CreateModel(
  76. name='SequenceAnnotation',
  77. fields=[
  78. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  79. ('prob', models.FloatField(default=0.0)),
  80. ('manual', models.BooleanField(default=False)),
  81. ('created_at', models.DateTimeField(auto_now_add=True)),
  82. ('updated_at', models.DateTimeField(auto_now=True)),
  83. ('start_offset', models.IntegerField()),
  84. ('end_offset', models.IntegerField()),
  85. ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seq_annotations', to='server.Document')),
  86. ('label', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='server.Label')),
  87. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  88. ],
  89. ),
  90. migrations.CreateModel(
  91. name='Seq2seqProject',
  92. fields=[
  93. ('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='server.Project')),
  94. ],
  95. options={
  96. 'abstract': False,
  97. 'base_manager_name': 'objects',
  98. },
  99. bases=('server.project',),
  100. ),
  101. migrations.CreateModel(
  102. name='SequenceLabelingProject',
  103. fields=[
  104. ('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='server.Project')),
  105. ],
  106. options={
  107. 'abstract': False,
  108. 'base_manager_name': 'objects',
  109. },
  110. bases=('server.project',),
  111. ),
  112. migrations.CreateModel(
  113. name='TextClassificationProject',
  114. fields=[
  115. ('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='server.Project')),
  116. ],
  117. options={
  118. 'abstract': False,
  119. 'base_manager_name': 'objects',
  120. },
  121. bases=('server.project',),
  122. ),
  123. migrations.AddField(
  124. model_name='project',
  125. name='polymorphic_ctype',
  126. field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_server.project_set+', to='contenttypes.ContentType'),
  127. ),
  128. migrations.AddField(
  129. model_name='project',
  130. name='users',
  131. field=models.ManyToManyField(related_name='projects', to=settings.AUTH_USER_MODEL),
  132. ),
  133. migrations.AddField(
  134. model_name='label',
  135. name='project',
  136. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='labels', to='server.Project'),
  137. ),
  138. migrations.AddField(
  139. model_name='documentannotation',
  140. name='label',
  141. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='server.Label'),
  142. ),
  143. migrations.AddField(
  144. model_name='documentannotation',
  145. name='user',
  146. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
  147. ),
  148. migrations.AddField(
  149. model_name='document',
  150. name='project',
  151. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='server.Project'),
  152. ),
  153. migrations.AlterUniqueTogether(
  154. name='sequenceannotation',
  155. unique_together={('document', 'user', 'label', 'start_offset', 'end_offset')},
  156. ),
  157. migrations.AlterUniqueTogether(
  158. name='seq2seqannotation',
  159. unique_together={('document', 'user', 'text')},
  160. ),
  161. migrations.AlterUniqueTogether(
  162. name='label',
  163. unique_together={('project', 'prefix_key', 'suffix_key'), ('project', 'text')},
  164. ),
  165. migrations.AlterUniqueTogether(
  166. name='documentannotation',
  167. unique_together={('document', 'user', 'label')},
  168. ),
  169. ]