Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / migrations / 0032_auto__add_astakosuserauthprovider__add_unique_astakosuserauthprovider_.py @ 215e87da

History | View | Annotate | Download (19.4 kB)

1
# encoding: utf-8
2
import datetime
3
from south.db import db
4
from south.v2 import SchemaMigration
5
from django.db import models
6

    
7
class Migration(SchemaMigration):
8

    
9
    def forwards(self, orm):
10
        
11
        # Adding model 'AstakosUserAuthProvider'
12
        db.create_table('im_astakosuserauthprovider', (
13
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14
            ('affiliation', self.gf('django.db.models.fields.CharField')(default=None, max_length=255, null=True, blank=True)),
15
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='auth_providers', to=orm['im.AstakosUser'])),
16
            ('module', self.gf('django.db.models.fields.CharField')(default='local', max_length=255)),
17
            ('identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
18
            ('active', self.gf('django.db.models.fields.BooleanField')(default=True)),
19
            ('auth_backend', self.gf('django.db.models.fields.CharField')(default='astakos', max_length=255)),
20
        ))
21
        db.send_create_signal('im', ['AstakosUserAuthProvider'])
22

    
23
        # Adding unique constraint on 'AstakosUserAuthProvider', fields ['identifier', 'module', 'user']
24
        db.create_unique('im_astakosuserauthprovider', ['identifier', 'module', 'user_id'])
25

    
26
        # Changing field 'AstakosUser.affiliation'
27
        db.alter_column('im_astakosuser', 'affiliation', self.gf('django.db.models.fields.CharField')(max_length=255, null=True))
28

    
29
        # Changing field 'AstakosUser.provider'
30
        db.alter_column('im_astakosuser', 'provider', self.gf('django.db.models.fields.CharField')(max_length=255, null=True))
31

    
32
        # Adding field 'PendingThirdPartyUser.token'
33
        db.add_column('im_pendingthirdpartyuser', 'token', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False)
34

    
35
        # Adding field 'PendingThirdPartyUser.created'
36
        db.add_column('im_pendingthirdpartyuser', 'created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True), keep_default=False)
37

    
38

    
39
    def backwards(self, orm):
40
        
41
        # Removing unique constraint on 'AstakosUserAuthProvider', fields ['identifier', 'module', 'user']
42
        db.delete_unique('im_astakosuserauthprovider', ['identifier', 'module', 'user_id'])
43

    
44
        # Deleting model 'AstakosUserAuthProvider'
45
        db.delete_table('im_astakosuserauthprovider')
46

    
47
        # Changing field 'AstakosUser.affiliation'
48
        db.alter_column('im_astakosuser', 'affiliation', self.gf('django.db.models.fields.CharField')(default='', max_length=255))
49

    
50
        # Changing field 'AstakosUser.provider'
51
        db.alter_column('im_astakosuser', 'provider', self.gf('django.db.models.fields.CharField')(default='', max_length=255))
52

    
53
        # Deleting field 'PendingThirdPartyUser.token'
54
        db.delete_column('im_pendingthirdpartyuser', 'token')
55

    
56
        # Deleting field 'PendingThirdPartyUser.created'
57
        db.delete_column('im_pendingthirdpartyuser', 'created')
58

    
59

    
60
    models = {
61
        'auth.group': {
62
            'Meta': {'object_name': 'Group'},
63
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
64
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
65
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
66
        },
67
        'auth.permission': {
68
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
69
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
70
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
71
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
72
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
73
        },
74
        'auth.user': {
75
            'Meta': {'object_name': 'User'},
76
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
77
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
78
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
79
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
80
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
81
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
82
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
83
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
84
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
85
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
86
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
87
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
88
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
89
        },
90
        'contenttypes.contenttype': {
91
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
92
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
93
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
94
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
95
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
96
        },
97
        'im.additionalmail': {
98
            'Meta': {'object_name': 'AdditionalMail'},
99
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
100
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
101
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
102
        },
103
        'im.approvalterms': {
104
            'Meta': {'object_name': 'ApprovalTerms'},
105
            'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 11, 30, 13, 40, 35, 392345)', 'db_index': 'True'}),
106
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
107
            'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
108
        },
109
        'im.astakosgroup': {
110
            'Meta': {'object_name': 'AstakosGroup', '_ormbases': ['auth.Group']},
111
            'approval_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
112
            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 11, 30, 13, 40, 35, 385497)'}),
113
            'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
114
            'estimated_participants': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
115
            'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
116
            'group_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.Group']", 'unique': 'True', 'primary_key': 'True'}),
117
            'homepage': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
118
            'issue_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
119
            'kind': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.GroupKind']"}),
120
            'max_participants': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
121
            'moderation_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
122
            'policy': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosGroupQuota']", 'blank': 'True'})
123
        },
124
        'im.astakosgroupquota': {
125
            'Meta': {'unique_together': "(('resource', 'group'),)", 'object_name': 'AstakosGroupQuota'},
126
            'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosGroup']", 'blank': 'True'}),
127
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
128
            'limit': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
129
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"}),
130
            'uplimit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'})
131
        },
132
        'im.astakosuser': {
133
            'Meta': {'unique_together': "(('provider', 'third_party_identifier'),)", 'object_name': 'AstakosUser', '_ormbases': ['auth.User']},
134
            'activation_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
135
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
136
            'astakos_groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.AstakosGroup']", 'symmetrical': 'False', 'through': "orm['im.Membership']", 'blank': 'True'}),
137
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
138
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
139
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
140
            'date_signed_terms': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
141
            'disturbed_quota': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
142
            'email_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
143
            'has_credits': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
144
            'has_signed_terms': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
145
            'invitations': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
146
            'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
147
            'level': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
148
            'owner': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'owner'", 'null': 'True', 'to': "orm['im.AstakosGroup']"}),
149
            'policy': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosUserQuota']", 'symmetrical': 'False'}),
150
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
151
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
152
            'updated': ('django.db.models.fields.DateTimeField', [], {}),
153
            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'})
154
        },
155
        'im.astakosuserauthprovider': {
156
            'Meta': {'unique_together': "(('identifier', 'module', 'user'),)", 'object_name': 'AstakosUserAuthProvider'},
157
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
158
            'affiliation': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
159
            'auth_backend': ('django.db.models.fields.CharField', [], {'default': "'astakos'", 'max_length': '255'}),
160
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
161
            'identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
162
            'module': ('django.db.models.fields.CharField', [], {'default': "'local'", 'max_length': '255'}),
163
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_providers'", 'to': "orm['im.AstakosUser']"})
164
        },
165
        'im.astakosuserquota': {
166
            'Meta': {'unique_together': "(('resource', 'user'),)", 'object_name': 'AstakosUserQuota'},
167
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
168
            'limit': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
169
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"}),
170
            'uplimit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
171
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
172
        },
173
        'im.emailchange': {
174
            'Meta': {'object_name': 'EmailChange'},
175
            'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}),
176
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
177
            'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
178
            'requested_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 11, 30, 13, 40, 35, 393088)'}),
179
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchange_user'", 'unique': 'True', 'to': "orm['im.AstakosUser']"})
180
        },
181
        'im.groupkind': {
182
            'Meta': {'object_name': 'GroupKind'},
183
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
184
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'})
185
        },
186
        'im.invitation': {
187
            'Meta': {'object_name': 'Invitation'},
188
            'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
189
            'consumed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
190
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
191
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
192
            'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
193
            'is_consumed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
194
            'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
195
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
196
        },
197
        'im.membership': {
198
            'Meta': {'unique_together': "(('person', 'group'),)", 'object_name': 'Membership'},
199
            'date_joined': ('django.db.models.fields.DateField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
200
            'date_requested': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 11, 30, 13, 40, 35, 390278)', 'blank': 'True'}),
201
            'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosGroup']"}),
202
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
203
            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
204
        },
205
        'im.pendingthirdpartyuser': {
206
            'Meta': {'unique_together': "(('provider', 'third_party_identifier'),)", 'object_name': 'PendingThirdPartyUser'},
207
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
208
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
209
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
210
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
211
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
212
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
213
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
214
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
215
            'token': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
216
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
217
        },
218
        'im.resource': {
219
            'Meta': {'object_name': 'Resource'},
220
            'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
221
            'group': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
222
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
223
            'meta': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.ResourceMetadata']", 'symmetrical': 'False'}),
224
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
225
            'service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Service']"}),
226
            'unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'})
227
        },
228
        'im.resourcemetadata': {
229
            'Meta': {'object_name': 'ResourceMetadata'},
230
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
231
            'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
232
            'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
233
        },
234
        'im.service': {
235
            'Meta': {'object_name': 'Service'},
236
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
237
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
238
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
239
            'icon': ('django.db.models.fields.FilePathField', [], {'max_length': '100', 'blank': 'True'}),
240
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
241
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
242
            'url': ('django.db.models.fields.FilePathField', [], {'max_length': '100'})
243
        },
244
        'im.sessioncatalog': {
245
            'Meta': {'object_name': 'SessionCatalog'},
246
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
247
            'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
248
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessions'", 'null': 'True', 'to': "orm['im.AstakosUser']"})
249
        }
250
    }
251

    
252
    complete_apps = ['im']