update emails for stage2
[edumed.git] / stage2 / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 from south.utils import datetime_utils as datetime
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
6
7
8 class Migration(SchemaMigration):
9
10     def forwards(self, orm):
11         # Adding model 'Participant'
12         db.create_table(u'stage2_participant', (
13             (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14             ('contact', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contact.Contact'], null=True)),
15             ('key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)),
16             ('first_name', self.gf('django.db.models.fields.CharField')(max_length=100)),
17             ('last_name', self.gf('django.db.models.fields.CharField')(max_length=100)),
18             ('email', self.gf('django.db.models.fields.EmailField')(unique=True, max_length=100)),
19             ('key_sent', self.gf('django.db.models.fields.BooleanField')(default=False)),
20         ))
21         db.send_create_signal(u'stage2', ['Participant'])
22
23         # Adding model 'Assignment'
24         db.create_table(u'stage2_assignment', (
25             (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
26             ('title', self.gf('django.db.models.fields.CharField')(max_length=128)),
27             ('content', self.gf('django.db.models.fields.TextField')()),
28             ('deadline', self.gf('django.db.models.fields.DateTimeField')()),
29             ('max_points', self.gf('django.db.models.fields.IntegerField')()),
30             ('file_descriptions', self.gf('jsonfield.fields.JSONField')()),
31         ))
32         db.send_create_signal(u'stage2', ['Assignment'])
33
34         # Adding model 'Answer'
35         db.create_table(u'stage2_answer', (
36             (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
37             ('participant', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['stage2.Participant'])),
38             ('assignment', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['stage2.Assignment'])),
39             ('uploaded_files', self.gf('jsonfield.fields.JSONField')()),
40         ))
41         db.send_create_signal(u'stage2', ['Answer'])
42
43         # Adding unique constraint on 'Answer', fields ['participant', 'assignment']
44         db.create_unique(u'stage2_answer', ['participant_id', 'assignment_id'])
45
46         # Adding model 'Mark'
47         db.create_table(u'stage2_mark', (
48             (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
49             ('expert', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
50             ('answer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['stage2.Answer'])),
51             ('points', self.gf('django.db.models.fields.DecimalField')(max_digits=3, decimal_places=1)),
52         ))
53         db.send_create_signal(u'stage2', ['Mark'])
54
55         # Adding unique constraint on 'Mark', fields ['expert', 'answer']
56         db.create_unique(u'stage2_mark', ['expert_id', 'answer_id'])
57
58
59     def backwards(self, orm):
60         # Removing unique constraint on 'Mark', fields ['expert', 'answer']
61         db.delete_unique(u'stage2_mark', ['expert_id', 'answer_id'])
62
63         # Removing unique constraint on 'Answer', fields ['participant', 'assignment']
64         db.delete_unique(u'stage2_answer', ['participant_id', 'assignment_id'])
65
66         # Deleting model 'Participant'
67         db.delete_table(u'stage2_participant')
68
69         # Deleting model 'Assignment'
70         db.delete_table(u'stage2_assignment')
71
72         # Deleting model 'Answer'
73         db.delete_table(u'stage2_answer')
74
75         # Deleting model 'Mark'
76         db.delete_table(u'stage2_mark')
77
78
79     models = {
80         u'auth.group': {
81             'Meta': {'object_name': 'Group'},
82             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83             'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
84             'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
85         },
86         u'auth.permission': {
87             'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
88             'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
89             'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
90             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
91             'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
92         },
93         u'auth.user': {
94             'Meta': {'object_name': 'User'},
95             'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
96             'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
97             'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
98             'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
99             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
100             'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
101             'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
102             'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
103             'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
104             'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
105             'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
106             'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
107             'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
108         },
109         u'contact.contact': {
110             'Meta': {'ordering': "('-created_at',)", 'object_name': 'Contact'},
111             'body': ('jsonfield.fields.JSONField', [], {}),
112             'contact': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
113             'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
114             'form_tag': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}),
115             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
116             'ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'})
117         },
118         u'contenttypes.contenttype': {
119             'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
120             'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
121             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122             'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
123             'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
124         },
125         u'stage2.answer': {
126             'Meta': {'unique_together': "(['participant', 'assignment'],)", 'object_name': 'Answer'},
127             'assignment': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Assignment']"}),
128             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
129             'participant': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Participant']"}),
130             'uploaded_files': ('jsonfield.fields.JSONField', [], {})
131         },
132         u'stage2.assignment': {
133             'Meta': {'ordering': "['deadline']", 'object_name': 'Assignment'},
134             'content': ('django.db.models.fields.TextField', [], {}),
135             'deadline': ('django.db.models.fields.DateTimeField', [], {}),
136             'file_descriptions': ('jsonfield.fields.JSONField', [], {}),
137             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
138             'max_points': ('django.db.models.fields.IntegerField', [], {}),
139             'title': ('django.db.models.fields.CharField', [], {'max_length': '128'})
140         },
141         u'stage2.mark': {
142             'Meta': {'unique_together': "(['expert', 'answer'],)", 'object_name': 'Mark'},
143             'answer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Answer']"}),
144             'expert': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
145             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
146             'points': ('django.db.models.fields.DecimalField', [], {'max_digits': '3', 'decimal_places': '1'})
147         },
148         u'stage2.participant': {
149             'Meta': {'object_name': 'Participant'},
150             'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contact.Contact']", 'null': 'True'}),
151             'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '100'}),
152             'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
153             u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
154             'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
155             'key_sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
156             'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
157         }
158     }
159
160     complete_apps = ['stage2']