1- # Generated by Django 2.1.7 on 2019-06-21 06:05
1+ # Generated by Django 2.1.7 on 2019-10-25 16:26
22
33from django .conf import settings
44from django .db import migrations , models
@@ -10,8 +10,8 @@ class Migration(migrations.Migration):
1010 initial = True
1111
1212 dependencies = [
13- ('contenttypes' , '0002_remove_content_type_name' ),
1413 migrations .swappable_dependency (settings .AUTH_USER_MODEL ),
14+ ('contenttypes' , '0002_remove_content_type_name' ),
1515 ]
1616
1717 operations = [
@@ -23,6 +23,7 @@ class Migration(migrations.Migration):
2323 ('meta' , models .TextField (default = '{}' )),
2424 ('created_at' , models .DateTimeField (auto_now_add = True )),
2525 ('updated_at' , models .DateTimeField (auto_now = True )),
26+ ('annotations_approved_by' , models .ForeignKey (null = True , on_delete = django .db .models .deletion .SET_NULL , to = settings .AUTH_USER_MODEL )),
2627 ],
2728 ),
2829 migrations .CreateModel (
@@ -60,12 +61,31 @@ class Migration(migrations.Migration):
6061 ('updated_at' , models .DateTimeField (auto_now = True )),
6162 ('project_type' , models .CharField (choices = [('DocumentClassification' , 'document classification' ), ('SequenceLabeling' , 'sequence labeling' ), ('Seq2seq' , 'sequence to sequence' )], max_length = 30 )),
6263 ('randomize_document_order' , models .BooleanField (default = False )),
64+ ('collaborative_annotation' , models .BooleanField (default = False )),
6365 ],
6466 options = {
6567 'abstract' : False ,
6668 'base_manager_name' : 'objects' ,
6769 },
6870 ),
71+ migrations .CreateModel (
72+ name = 'Role' ,
73+ fields = [
74+ ('id' , models .AutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
75+ ('name' , models .CharField (max_length = 100 , unique = True )),
76+ ('description' , models .TextField (default = '' )),
77+ ('created_at' , models .DateTimeField (auto_now_add = True )),
78+ ('updated_at' , models .DateTimeField (auto_now = True )),
79+ ],
80+ ),
81+ migrations .CreateModel (
82+ name = 'RoleMapping' ,
83+ fields = [
84+ ('id' , models .AutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
85+ ('created_at' , models .DateTimeField (auto_now_add = True )),
86+ ('updated_at' , models .DateTimeField (auto_now = True )),
87+ ],
88+ ),
6989 migrations .CreateModel (
7090 name = 'Seq2seqAnnotation' ,
7191 fields = [
@@ -74,7 +94,7 @@ class Migration(migrations.Migration):
7494 ('manual' , models .BooleanField (default = False )),
7595 ('created_at' , models .DateTimeField (auto_now_add = True )),
7696 ('updated_at' , models .DateTimeField (auto_now = True )),
77- ('text' , models .TextField ( )),
97+ ('text' , models .CharField ( max_length = 500 )),
7898 ('document' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'seq2seq_annotations' , to = 'api.Document' )),
7999 ('user' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , to = settings .AUTH_USER_MODEL )),
80100 ],
@@ -127,6 +147,21 @@ class Migration(migrations.Migration):
127147 },
128148 bases = ('api.project' ,),
129149 ),
150+ migrations .AddField (
151+ model_name = 'rolemapping' ,
152+ name = 'project' ,
153+ field = models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'role_mappings' , to = 'api.Project' ),
154+ ),
155+ migrations .AddField (
156+ model_name = 'rolemapping' ,
157+ name = 'role' ,
158+ field = models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , to = 'api.Role' ),
159+ ),
160+ migrations .AddField (
161+ model_name = 'rolemapping' ,
162+ name = 'user' ,
163+ field = models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'role_mappings' , to = settings .AUTH_USER_MODEL ),
164+ ),
130165 migrations .AddField (
131166 model_name = 'project' ,
132167 name = 'polymorphic_ctype' ,
@@ -161,9 +196,17 @@ class Migration(migrations.Migration):
161196 name = 'sequenceannotation' ,
162197 unique_together = {('document' , 'user' , 'label' , 'start_offset' , 'end_offset' )},
163198 ),
199+ migrations .AlterUniqueTogether (
200+ name = 'seq2seqannotation' ,
201+ unique_together = {('document' , 'user' , 'text' )},
202+ ),
203+ migrations .AlterUniqueTogether (
204+ name = 'rolemapping' ,
205+ unique_together = {('user' , 'project' , 'role' )},
206+ ),
164207 migrations .AlterUniqueTogether (
165208 name = 'label' ,
166- unique_together = {('project' , 'text' ), ( 'project' , 'prefix_key' , 'suffix_key' ) },
209+ unique_together = {('project' , 'text' )},
167210 ),
168211 migrations .AlterUniqueTogether (
169212 name = 'documentannotation' ,
0 commit comments