Revision 41e92ef2

b/snf-astakos-app/astakos/im/migrations/0054_reduce_bigint.py
1
# -*- coding: utf-8 -*-
2
import datetime
3
from south.db import db
4
from south.v2 import DataMigration
5
from django.db import models
6

  
7
MAX = 2**63 - 1
8

  
9
class Migration(DataMigration):
10

  
11
    def forwards(self, orm):
12
        orm.Resource.objects.filter(uplimit__gt=MAX).update(uplimit=MAX)
13
        orm.AstakosUserQuota.objects.filter(capacity__gt=MAX).\
14
            update(capacity=MAX)
15
        orm.ProjectResourceGrant.objects.filter(project_capacity__gt=MAX).\
16
            update(project_capacity=MAX)
17
        orm.ProjectResourceGrant.objects.filter(member_capacity__gt=MAX).\
18
            update(member_capacity=MAX)
19

  
20
    def backwards(self, orm):
21
        "Write your backwards methods here."
22

  
23
    models = {
24
        'auth.group': {
25
            'Meta': {'object_name': 'Group'},
26
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
27
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
28
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
29
        },
30
        'auth.permission': {
31
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
32
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
33
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
34
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
35
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
36
        },
37
        'auth.user': {
38
            'Meta': {'object_name': 'User'},
39
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
40
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
41
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
42
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
43
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
44
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
45
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
46
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
47
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
48
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
49
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
50
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
51
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
52
        },
53
        'contenttypes.contenttype': {
54
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
55
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
56
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
57
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
58
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
59
        },
60
        'im.additionalmail': {
61
            'Meta': {'object_name': 'AdditionalMail'},
62
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
63
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
64
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
65
        },
66
        'im.approvalterms': {
67
            'Meta': {'object_name': 'ApprovalTerms'},
68
            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
69
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70
            'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
71
        },
72
        'im.astakosuser': {
73
            'Meta': {'object_name': 'AstakosUser', '_ormbases': ['auth.User']},
74
            'accepted_email': ('django.db.models.fields.EmailField', [], {'default': 'None', 'max_length': '75', 'null': 'True', 'blank': 'True'}),
75
            'accepted_policy': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
76
            'activation_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
77
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
78
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
79
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
80
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
81
            'date_signed_terms': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
82
            'deactivated_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
83
            'deactivated_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
84
            'disturbed_quota': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
85
            'email_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
86
            'has_credits': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
87
            'has_signed_terms': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
88
            'invitations': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
89
            'is_rejected': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
90
            'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
91
            'level': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
92
            'moderated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
93
            'moderated_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
94
            'moderated_data': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
95
            'policy': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosUserQuota']", 'symmetrical': 'False'}),
96
            'rejected_reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
97
            'updated': ('django.db.models.fields.DateTimeField', [], {}),
98
            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
99
            'uuid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'}),
100
            'verification_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'}),
101
            'verified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
102
        },
103
        'im.astakosuserauthprovider': {
104
            'Meta': {'ordering': "('module', 'created')", 'unique_together': "(('identifier', 'module', 'user'),)", 'object_name': 'AstakosUserAuthProvider'},
105
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
106
            'affiliation': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
107
            'auth_backend': ('django.db.models.fields.CharField', [], {'default': "'astakos'", 'max_length': '255'}),
108
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
109
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
110
            'identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
111
            'info_data': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
112
            'module': ('django.db.models.fields.CharField', [], {'default': "'local'", 'max_length': '255'}),
113
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_providers'", 'to': "orm['im.AstakosUser']"})
114
        },
115
        'im.astakosuserquota': {
116
            'Meta': {'unique_together': "(('resource', 'user'),)", 'object_name': 'AstakosUserQuota'},
117
            'capacity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
118
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
119
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"}),
120
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
121
        },
122
        'im.authproviderpolicyprofile': {
123
            'Meta': {'ordering': "['priority']", 'object_name': 'AuthProviderPolicyProfile'},
124
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
125
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'authpolicy_profiles'", 'symmetrical': 'False', 'to': "orm['auth.Group']"}),
126
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
127
            'is_exclusive': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
128
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
129
            'policy_add': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
130
            'policy_automoderate': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
131
            'policy_create': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
132
            'policy_limit': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}),
133
            'policy_login': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
134
            'policy_remove': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
135
            'policy_required': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
136
            'policy_switch': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
137
            'priority': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
138
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
139
            'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'authpolicy_profiles'", 'symmetrical': 'False', 'to': "orm['im.AstakosUser']"})
140
        },
141
        'im.chain': {
142
            'Meta': {'object_name': 'Chain'},
143
            'chain': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
144
        },
145
        'im.component': {
146
            'Meta': {'object_name': 'Component'},
147
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
148
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
149
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
150
            'base_url': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
151
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
152
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
153
            'url': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'})
154
        },
155
        'im.emailchange': {
156
            'Meta': {'object_name': 'EmailChange'},
157
            'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}),
158
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
159
            'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
160
            'requested_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
161
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchanges'", 'unique': 'True', 'to': "orm['im.AstakosUser']"})
162
        },
163
        'im.endpoint': {
164
            'Meta': {'object_name': 'Endpoint'},
165
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
166
            'service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'endpoints'", 'to': "orm['im.Service']"})
167
        },
168
        'im.endpointdata': {
169
            'Meta': {'unique_together': "(('endpoint', 'key'),)", 'object_name': 'EndpointData'},
170
            'endpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'data'", 'to': "orm['im.Endpoint']"}),
171
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
172
            'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
173
            'value': ('django.db.models.fields.CharField', [], {'max_length': '1024'})
174
        },
175
        'im.invitation': {
176
            'Meta': {'object_name': 'Invitation'},
177
            'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
178
            'consumed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
179
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
180
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
181
            'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
182
            'is_consumed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
183
            'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
184
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
185
        },
186
        'im.pendingthirdpartyuser': {
187
            'Meta': {'unique_together': "(('provider', 'third_party_identifier'),)", 'object_name': 'PendingThirdPartyUser'},
188
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
189
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
190
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
191
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
192
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
193
            'info': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
194
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
195
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
196
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
197
            'token': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
198
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
199
        },
200
        'im.project': {
201
            'Meta': {'object_name': 'Project'},
202
            'application': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'project'", 'unique': 'True', 'to': "orm['im.ProjectApplication']"}),
203
            'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
204
            'id': ('django.db.models.fields.BigIntegerField', [], {'primary_key': 'True', 'db_column': "'id'"}),
205
            'members': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.AstakosUser']", 'through': "orm['im.ProjectMembership']", 'symmetrical': 'False'}),
206
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True', 'null': 'True', 'db_index': 'True'}),
207
            'state': ('django.db.models.fields.IntegerField', [], {'default': '1', 'db_index': 'True'})
208
        },
209
        'im.projectapplication': {
210
            'Meta': {'unique_together': "(('chain', 'id'),)", 'object_name': 'ProjectApplication'},
211
            'applicant': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_applied'", 'to': "orm['im.AstakosUser']"}),
212
            'chain': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'chained_apps'", 'db_column': "'chain'", 'to': "orm['im.Project']"}),
213
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
214
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
215
            'end_date': ('django.db.models.fields.DateTimeField', [], {}),
216
            'homepage': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True'}),
217
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
218
            'issue_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
219
            'limit_on_members_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
220
            'member_join_policy': ('django.db.models.fields.IntegerField', [], {}),
221
            'member_leave_policy': ('django.db.models.fields.IntegerField', [], {}),
222
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
223
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_owned'", 'to': "orm['im.AstakosUser']"}),
224
            'resource_grants': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.ProjectResourceGrant']", 'blank': 'True'}),
225
            'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
226
            'response_actor': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'responded_apps'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
227
            'response_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
228
            'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
229
            'state': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}),
230
            'waive_actor': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'waived_apps'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
231
            'waive_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
232
            'waive_reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
233
        },
234
        'im.projectlock': {
235
            'Meta': {'object_name': 'ProjectLock'},
236
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
237
        },
238
        'im.projectlog': {
239
            'Meta': {'object_name': 'ProjectLog'},
240
            'actor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']", 'null': 'True'}),
241
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True'}),
242
            'date': ('django.db.models.fields.DateTimeField', [], {}),
243
            'from_state': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
244
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
245
            'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'log'", 'to': "orm['im.Project']"}),
246
            'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}),
247
            'to_state': ('django.db.models.fields.IntegerField', [], {})
248
        },
249
        'im.projectmembership': {
250
            'Meta': {'unique_together': "(('person', 'project'),)", 'object_name': 'ProjectMembership'},
251
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
252
            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
253
            'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}),
254
            'state': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'})
255
        },
256
        'im.projectmembershiplog': {
257
            'Meta': {'object_name': 'ProjectMembershipLog'},
258
            'actor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']", 'null': 'True'}),
259
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True'}),
260
            'date': ('django.db.models.fields.DateTimeField', [], {}),
261
            'from_state': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
262
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
263
            'membership': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'log'", 'to': "orm['im.ProjectMembership']"}),
264
            'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}),
265
            'to_state': ('django.db.models.fields.IntegerField', [], {})
266
        },
267
        'im.projectresourcegrant': {
268
            'Meta': {'unique_together': "(('resource', 'project_application'),)", 'object_name': 'ProjectResourceGrant'},
269
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
270
            'member_capacity': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}),
271
            'project_application': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.ProjectApplication']", 'null': 'True'}),
272
            'project_capacity': ('snf_django.lib.db.fields.IntDecimalField', [], {'null': 'True', 'max_digits': '38', 'decimal_places': '0'}),
273
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"})
274
        },
275
        'im.resource': {
276
            'Meta': {'object_name': 'Resource'},
277
            'allow_in_projects': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
278
            'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
279
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
280
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
281
            'service_origin': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
282
            'service_type': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
283
            'unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
284
            'uplimit': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'})
285
        },
286
        'im.service': {
287
            'Meta': {'object_name': 'Service'},
288
            'component': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Component']"}),
289
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
290
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
291
            'type': ('django.db.models.fields.CharField', [], {'max_length': '255'})
292
        },
293
        'im.sessioncatalog': {
294
            'Meta': {'object_name': 'SessionCatalog'},
295
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
296
            'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
297
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessions'", 'null': 'True', 'to': "orm['im.AstakosUser']"})
298
        },
299
        'im.usersetting': {
300
            'Meta': {'unique_together': "(('user', 'setting'),)", 'object_name': 'UserSetting'},
301
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
302
            'setting': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
303
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
304
            'value': ('django.db.models.fields.IntegerField', [], {})
305
        }
306
    }
307

  
308
    complete_apps = ['im']
309
    symmetrical = True
b/snf-astakos-app/astakos/im/migrations/0055_auto__chg_field_resource_uplimit__chg_field_astakosuserquota_capacity_.py
1
# -*- coding: 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

  
8
class Migration(SchemaMigration):
9

  
10
    def forwards(self, orm):
11

  
12
        # Changing field 'Resource.uplimit'
13
        db.alter_column('im_resource', 'uplimit', self.gf('django.db.models.fields.BigIntegerField')())
14

  
15
        # Changing field 'AstakosUserQuota.capacity'
16
        db.alter_column('im_astakosuserquota', 'capacity', self.gf('django.db.models.fields.BigIntegerField')())
17

  
18
        # Changing field 'ProjectResourceGrant.project_capacity'
19
        db.alter_column('im_projectresourcegrant', 'project_capacity', self.gf('django.db.models.fields.BigIntegerField')(null=True))
20

  
21
        # Changing field 'ProjectResourceGrant.member_capacity'
22
        db.alter_column('im_projectresourcegrant', 'member_capacity', self.gf('django.db.models.fields.BigIntegerField')())
23

  
24
    def backwards(self, orm):
25

  
26
        # Changing field 'Resource.uplimit'
27
        db.alter_column('im_resource', 'uplimit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
28

  
29
        # Changing field 'AstakosUserQuota.capacity'
30
        db.alter_column('im_astakosuserquota', 'capacity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
31

  
32
        # Changing field 'ProjectResourceGrant.project_capacity'
33
        db.alter_column('im_projectresourcegrant', 'project_capacity', self.gf('snf_django.lib.db.fields.IntDecimalField')(null=True, max_digits=38, decimal_places=0))
34

  
35
        # Changing field 'ProjectResourceGrant.member_capacity'
36
        db.alter_column('im_projectresourcegrant', 'member_capacity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
37

  
38
    models = {
39
        'auth.group': {
40
            'Meta': {'object_name': 'Group'},
41
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
42
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
43
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
44
        },
45
        'auth.permission': {
46
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
47
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
48
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
49
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
50
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
51
        },
52
        'auth.user': {
53
            'Meta': {'object_name': 'User'},
54
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
55
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
56
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
57
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
58
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
59
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
60
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
61
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
62
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
63
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
64
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
65
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
66
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
67
        },
68
        'contenttypes.contenttype': {
69
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
70
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
71
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
72
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
73
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
74
        },
75
        'im.additionalmail': {
76
            'Meta': {'object_name': 'AdditionalMail'},
77
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
78
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
79
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
80
        },
81
        'im.approvalterms': {
82
            'Meta': {'object_name': 'ApprovalTerms'},
83
            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
84
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
85
            'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
86
        },
87
        'im.astakosuser': {
88
            'Meta': {'object_name': 'AstakosUser', '_ormbases': ['auth.User']},
89
            'accepted_email': ('django.db.models.fields.EmailField', [], {'default': 'None', 'max_length': '75', 'null': 'True', 'blank': 'True'}),
90
            'accepted_policy': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
91
            'activation_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
92
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
93
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
94
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
95
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
96
            'date_signed_terms': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
97
            'deactivated_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
98
            'deactivated_reason': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
99
            'disturbed_quota': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
100
            'email_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
101
            'has_credits': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
102
            'has_signed_terms': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
103
            'invitations': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
104
            'is_rejected': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
105
            'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
106
            'level': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
107
            'moderated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
108
            'moderated_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
109
            'moderated_data': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
110
            'policy': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosUserQuota']", 'symmetrical': 'False'}),
111
            'rejected_reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
112
            'updated': ('django.db.models.fields.DateTimeField', [], {}),
113
            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
114
            'uuid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'}),
115
            'verification_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'}),
116
            'verified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
117
        },
118
        'im.astakosuserauthprovider': {
119
            'Meta': {'ordering': "('module', 'created')", 'unique_together': "(('identifier', 'module', 'user'),)", 'object_name': 'AstakosUserAuthProvider'},
120
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
121
            'affiliation': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
122
            'auth_backend': ('django.db.models.fields.CharField', [], {'default': "'astakos'", 'max_length': '255'}),
123
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
124
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125
            'identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
126
            'info_data': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
127
            'module': ('django.db.models.fields.CharField', [], {'default': "'local'", 'max_length': '255'}),
128
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_providers'", 'to': "orm['im.AstakosUser']"})
129
        },
130
        'im.astakosuserquota': {
131
            'Meta': {'unique_together': "(('resource', 'user'),)", 'object_name': 'AstakosUserQuota'},
132
            'capacity': ('django.db.models.fields.BigIntegerField', [], {}),
133
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
134
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"}),
135
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
136
        },
137
        'im.authproviderpolicyprofile': {
138
            'Meta': {'ordering': "['priority']", 'object_name': 'AuthProviderPolicyProfile'},
139
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
140
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'authpolicy_profiles'", 'symmetrical': 'False', 'to': "orm['auth.Group']"}),
141
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
142
            'is_exclusive': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
143
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
144
            'policy_add': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
145
            'policy_automoderate': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
146
            'policy_create': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
147
            'policy_limit': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True'}),
148
            'policy_login': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
149
            'policy_remove': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
150
            'policy_required': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
151
            'policy_switch': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
152
            'priority': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
153
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
154
            'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'authpolicy_profiles'", 'symmetrical': 'False', 'to': "orm['im.AstakosUser']"})
155
        },
156
        'im.chain': {
157
            'Meta': {'object_name': 'Chain'},
158
            'chain': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
159
        },
160
        'im.component': {
161
            'Meta': {'object_name': 'Component'},
162
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
163
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
164
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
165
            'base_url': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
166
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
167
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
168
            'url': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'})
169
        },
170
        'im.emailchange': {
171
            'Meta': {'object_name': 'EmailChange'},
172
            'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}),
173
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
174
            'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
175
            'requested_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
176
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchanges'", 'unique': 'True', 'to': "orm['im.AstakosUser']"})
177
        },
178
        'im.endpoint': {
179
            'Meta': {'object_name': 'Endpoint'},
180
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
181
            'service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'endpoints'", 'to': "orm['im.Service']"})
182
        },
183
        'im.endpointdata': {
184
            'Meta': {'unique_together': "(('endpoint', 'key'),)", 'object_name': 'EndpointData'},
185
            'endpoint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'data'", 'to': "orm['im.Endpoint']"}),
186
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
187
            'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
188
            'value': ('django.db.models.fields.CharField', [], {'max_length': '1024'})
189
        },
190
        'im.invitation': {
191
            'Meta': {'object_name': 'Invitation'},
192
            'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
193
            'consumed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
194
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
195
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
196
            'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
197
            'is_consumed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
198
            'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
199
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
200
        },
201
        'im.pendingthirdpartyuser': {
202
            'Meta': {'unique_together': "(('provider', 'third_party_identifier'),)", 'object_name': 'PendingThirdPartyUser'},
203
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
204
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
205
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
206
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
207
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
208
            'info': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
209
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
210
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
211
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
212
            'token': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
213
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
214
        },
215
        'im.project': {
216
            'Meta': {'object_name': 'Project'},
217
            'application': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'project'", 'unique': 'True', 'to': "orm['im.ProjectApplication']"}),
218
            'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
219
            'id': ('django.db.models.fields.BigIntegerField', [], {'primary_key': 'True', 'db_column': "'id'"}),
220
            'members': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.AstakosUser']", 'through': "orm['im.ProjectMembership']", 'symmetrical': 'False'}),
221
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True', 'null': 'True', 'db_index': 'True'}),
222
            'state': ('django.db.models.fields.IntegerField', [], {'default': '1', 'db_index': 'True'})
223
        },
224
        'im.projectapplication': {
225
            'Meta': {'unique_together': "(('chain', 'id'),)", 'object_name': 'ProjectApplication'},
226
            'applicant': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_applied'", 'to': "orm['im.AstakosUser']"}),
227
            'chain': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'chained_apps'", 'db_column': "'chain'", 'to': "orm['im.Project']"}),
228
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
229
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
230
            'end_date': ('django.db.models.fields.DateTimeField', [], {}),
231
            'homepage': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True'}),
232
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
233
            'issue_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
234
            'limit_on_members_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
235
            'member_join_policy': ('django.db.models.fields.IntegerField', [], {}),
236
            'member_leave_policy': ('django.db.models.fields.IntegerField', [], {}),
237
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
238
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_owned'", 'to': "orm['im.AstakosUser']"}),
239
            'resource_grants': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.ProjectResourceGrant']", 'blank': 'True'}),
240
            'response': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
241
            'response_actor': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'responded_apps'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
242
            'response_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
243
            'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
244
            'state': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}),
245
            'waive_actor': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'waived_apps'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
246
            'waive_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
247
            'waive_reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
248
        },
249
        'im.projectlock': {
250
            'Meta': {'object_name': 'ProjectLock'},
251
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
252
        },
253
        'im.projectlog': {
254
            'Meta': {'object_name': 'ProjectLog'},
255
            'actor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']", 'null': 'True'}),
256
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True'}),
257
            'date': ('django.db.models.fields.DateTimeField', [], {}),
258
            'from_state': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
259
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
260
            'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'log'", 'to': "orm['im.Project']"}),
261
            'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}),
262
            'to_state': ('django.db.models.fields.IntegerField', [], {})
263
        },
264
        'im.projectmembership': {
265
            'Meta': {'unique_together': "(('person', 'project'),)", 'object_name': 'ProjectMembership'},
266
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
267
            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
268
            'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}),
269
            'state': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'})
270
        },
271
        'im.projectmembershiplog': {
272
            'Meta': {'object_name': 'ProjectMembershipLog'},
273
            'actor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']", 'null': 'True'}),
274
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True'}),
275
            'date': ('django.db.models.fields.DateTimeField', [], {}),
276
            'from_state': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
277
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
278
            'membership': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'log'", 'to': "orm['im.ProjectMembership']"}),
279
            'reason': ('django.db.models.fields.TextField', [], {'null': 'True'}),
280
            'to_state': ('django.db.models.fields.IntegerField', [], {})
281
        },
282
        'im.projectresourcegrant': {
283
            'Meta': {'unique_together': "(('resource', 'project_application'),)", 'object_name': 'ProjectResourceGrant'},
284
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
285
            'member_capacity': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
286
            'project_application': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.ProjectApplication']", 'null': 'True'}),
287
            'project_capacity': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
288
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"})
289
        },
290
        'im.resource': {
291
            'Meta': {'object_name': 'Resource'},
292
            'allow_in_projects': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
293
            'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
294
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
295
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
296
            'service_origin': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
297
            'service_type': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
298
            'unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
299
            'uplimit': ('django.db.models.fields.BigIntegerField', [], {'default': '0'})
300
        },
301
        'im.service': {
302
            'Meta': {'object_name': 'Service'},
303
            'component': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Component']"}),
304
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
305
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
306
            'type': ('django.db.models.fields.CharField', [], {'max_length': '255'})
307
        },
308
        'im.sessioncatalog': {
309
            'Meta': {'object_name': 'SessionCatalog'},
310
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
311
            'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
312
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessions'", 'null': 'True', 'to': "orm['im.AstakosUser']"})
313
        },
314
        'im.usersetting': {
315
            'Meta': {'unique_together': "(('user', 'setting'),)", 'object_name': 'UserSetting'},
316
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
317
            'setting': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
318
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
319
            'value': ('django.db.models.fields.IntegerField', [], {})
320
        }
321
    }
322

  
323
    complete_apps = ['im']
b/snf-astakos-app/astakos/im/models.py
64 64
import astakos.im.messages as astakos_messages
65 65
from synnefo.lib.ordereddict import OrderedDict
66 66

  
67
from snf_django.lib.db.fields import intDecimalField
68 67
from synnefo.util.text import uenc, udec
69 68
from synnefo.util import units
70 69
from astakos.im import presentation
......
233 232
    service_type = models.CharField(_('Type'), max_length=255)
234 233
    service_origin = models.CharField(max_length=255, db_index=True)
235 234
    unit = models.CharField(_('Unit'), null=True, max_length=255)
236
    uplimit = intDecimalField(default=0)
235
    uplimit = models.BigIntegerField(default=0)
237 236
    allow_in_projects = models.BooleanField(default=True)
238 237

  
239 238
    def __str__(self):
......
1021 1020

  
1022 1021

  
1023 1022
class AstakosUserQuota(models.Model):
1024
    capacity = intDecimalField()
1023
    capacity = models.BigIntegerField()
1025 1024
    resource = models.ForeignKey(Resource)
1026 1025
    user = models.ForeignKey(AstakosUser)
1027 1026

  
......
1493 1492
    resource = models.ForeignKey(Resource)
1494 1493
    project_application = models.ForeignKey(ProjectApplication,
1495 1494
                                            null=True)
1496
    project_capacity = intDecimalField(null=True)
1497
    member_capacity = intDecimalField(default=0)
1495
    project_capacity = models.BigIntegerField(null=True)
1496
    member_capacity = models.BigIntegerField(default=0)
1498 1497

  
1499 1498
    objects = ProjectResourceGrantManager()
1500 1499

  
b/snf-astakos-app/astakos/quotaholder_app/migrations/0008_reduce_bigint.py
1
# -*- coding: utf-8 -*-
2
import datetime
3
from south.db import db
4
from south.v2 import DataMigration
5
from django.db import models
6

  
7
MAX = 2**63 - 1
8

  
9
class Migration(DataMigration):
10

  
11
    def forwards(self, orm):
12
        orm.Provision.objects.filter(quantity__gt=MAX).update(quantity=MAX)
13
        orm.Holding.objects.filter(usage_min__gt=MAX).update(usage_min=MAX)
14
        orm.Holding.objects.filter(usage_max__gt=MAX).update(usage_max=MAX)
15
        orm.Holding.objects.filter(limit__gt=MAX).update(limit=MAX)
16
        orm.ProvisionLog.objects.filter(delta_quantity__gt=MAX).\
17
            update(delta_quantity=MAX)
18
        orm.ProvisionLog.objects.filter(usage_min__gt=MAX).\
19
            update(usage_min=MAX)
20
        orm.ProvisionLog.objects.filter(usage_max__gt=MAX).\
21
            update(usage_max=MAX)
22
        orm.ProvisionLog.objects.filter(limit__gt=MAX).update(limit=MAX)
23

  
24
    def backwards(self, orm):
25
        "Write your backwards methods here."
26

  
27
    models = {
28
        'quotaholder_app.commission': {
29
            'Meta': {'object_name': 'Commission'},
30
            'clientkey': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
31
            'issue_datetime': ('django.db.models.fields.DateTimeField', [], {}),
32
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '4096'}),
33
            'serial': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
34
        },
35
        'quotaholder_app.holding': {
36
            'Meta': {'unique_together': "(('holder', 'source', 'resource'),)", 'object_name': 'Holding'},
37
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'db_index': 'True'}),
38
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
39
            'limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
40
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
41
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
42
            'usage_max': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}),
43
            'usage_min': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'})
44
        },
45
        'quotaholder_app.provision': {
46
            'Meta': {'object_name': 'Provision'},
47
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'db_index': 'True'}),
48
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
49
            'quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
50
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
51
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'provisions'", 'to': "orm['quotaholder_app.Commission']"}),
52
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'})
53
        },
54
        'quotaholder_app.provisionlog': {
55
            'Meta': {'object_name': 'ProvisionLog'},
56
            'delta_quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
57
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
58
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
59
            'issue_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
60
            'limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
61
            'log_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
62
            'name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
63
            'reason': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
64
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
65
            'serial': ('django.db.models.fields.BigIntegerField', [], {}),
66
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
67
            'usage_max': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
68
            'usage_min': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'})
69
        }
70
    }
71

  
72
    complete_apps = ['quotaholder_app']
73
    symmetrical = True
b/snf-astakos-app/astakos/quotaholder_app/migrations/0009_auto__chg_field_provision_quantity__chg_field_holding_usage_min__chg_f.py
1
# -*- coding: 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

  
8
class Migration(SchemaMigration):
9

  
10
    def forwards(self, orm):
11

  
12
        # Changing field 'Provision.quantity'
13
        db.alter_column('quotaholder_app_provision', 'quantity', self.gf('django.db.models.fields.BigIntegerField')())
14

  
15
        # Changing field 'Holding.usage_min'
16
        db.alter_column('quotaholder_app_holding', 'usage_min', self.gf('django.db.models.fields.BigIntegerField')())
17

  
18
        # Changing field 'Holding.usage_max'
19
        db.alter_column('quotaholder_app_holding', 'usage_max', self.gf('django.db.models.fields.BigIntegerField')())
20

  
21
        # Changing field 'Holding.limit'
22
        db.alter_column('quotaholder_app_holding', 'limit', self.gf('django.db.models.fields.BigIntegerField')())
23

  
24
        # Changing field 'ProvisionLog.usage_max'
25
        db.alter_column('quotaholder_app_provisionlog', 'usage_max', self.gf('django.db.models.fields.BigIntegerField')())
26

  
27
        # Changing field 'ProvisionLog.delta_quantity'
28
        db.alter_column('quotaholder_app_provisionlog', 'delta_quantity', self.gf('django.db.models.fields.BigIntegerField')())
29

  
30
        # Changing field 'ProvisionLog.limit'
31
        db.alter_column('quotaholder_app_provisionlog', 'limit', self.gf('django.db.models.fields.BigIntegerField')())
32

  
33
        # Changing field 'ProvisionLog.usage_min'
34
        db.alter_column('quotaholder_app_provisionlog', 'usage_min', self.gf('django.db.models.fields.BigIntegerField')())
35

  
36
    def backwards(self, orm):
37

  
38
        # Changing field 'Provision.quantity'
39
        db.alter_column('quotaholder_app_provision', 'quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
40

  
41
        # Changing field 'Holding.usage_min'
42
        db.alter_column('quotaholder_app_holding', 'usage_min', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
43

  
44
        # Changing field 'Holding.usage_max'
45
        db.alter_column('quotaholder_app_holding', 'usage_max', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
46

  
47
        # Changing field 'Holding.limit'
48
        db.alter_column('quotaholder_app_holding', 'limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
49

  
50
        # Changing field 'ProvisionLog.usage_max'
51
        db.alter_column('quotaholder_app_provisionlog', 'usage_max', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
52

  
53
        # Changing field 'ProvisionLog.delta_quantity'
54
        db.alter_column('quotaholder_app_provisionlog', 'delta_quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
55

  
56
        # Changing field 'ProvisionLog.limit'
57
        db.alter_column('quotaholder_app_provisionlog', 'limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
58

  
59
        # Changing field 'ProvisionLog.usage_min'
60
        db.alter_column('quotaholder_app_provisionlog', 'usage_min', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0))
61

  
62
    models = {
63
        'quotaholder_app.commission': {
64
            'Meta': {'object_name': 'Commission'},
65
            'clientkey': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
66
            'issue_datetime': ('django.db.models.fields.DateTimeField', [], {}),
67
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '4096'}),
68
            'serial': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
69
        },
70
        'quotaholder_app.holding': {
71
            'Meta': {'unique_together': "(('holder', 'source', 'resource'),)", 'object_name': 'Holding'},
72
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'db_index': 'True'}),
73
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74
            'limit': ('django.db.models.fields.BigIntegerField', [], {}),
75
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
76
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
77
            'usage_max': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
78
            'usage_min': ('django.db.models.fields.BigIntegerField', [], {'default': '0'})
79
        },
80
        'quotaholder_app.provision': {
81
            'Meta': {'object_name': 'Provision'},
82
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'db_index': 'True'}),
83
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
84
            'quantity': ('django.db.models.fields.BigIntegerField', [], {}),
85
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
86
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'provisions'", 'to': "orm['quotaholder_app.Commission']"}),
87
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'})
88
        },
89
        'quotaholder_app.provisionlog': {
90
            'Meta': {'object_name': 'ProvisionLog'},
91
            'delta_quantity': ('django.db.models.fields.BigIntegerField', [], {}),
92
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
93
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
94
            'issue_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
95
            'limit': ('django.db.models.fields.BigIntegerField', [], {}),
96
            'log_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
97
            'name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
98
            'reason': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
99
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
100
            'serial': ('django.db.models.fields.BigIntegerField', [], {}),
101
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
102
            'usage_max': ('django.db.models.fields.BigIntegerField', [], {}),
103
            'usage_min': ('django.db.models.fields.BigIntegerField', [], {})
104
        }
105
    }
106

  
107
    complete_apps = ['quotaholder_app']
b/snf-astakos-app/astakos/quotaholder_app/models.py
31 31
# interpreted as representing official policies, either expressed
32 32
# or implied, of GRNET S.A.
33 33

  
34
from snf_django.lib.db.fields import intDecimalField
35

  
36 34
from django.db.models import (Model, BigIntegerField, CharField, DateTimeField,
37 35
                              ForeignKey, AutoField)
38 36

  
......
43 41
    source = CharField(max_length=4096, null=True)
44 42
    resource = CharField(max_length=4096, null=False)
45 43

  
46
    limit = intDecimalField()
47
    usage_min = intDecimalField(default=0)
48
    usage_max = intDecimalField(default=0)
44
    limit = BigIntegerField()
45
    usage_min = BigIntegerField(default=0)
46
    usage_max = BigIntegerField(default=0)
49 47

  
50 48
    class Meta:
51 49
        unique_together = (('holder', 'source', 'resource'),)
......
68 66
    source = CharField(max_length=4096, null=True)
69 67
    resource = CharField(max_length=4096, null=False)
70 68

  
71
    quantity = intDecimalField()
69
    quantity = BigIntegerField()
72 70

  
73 71
    def todict(self):
74 72
        return {'holder':   self.holder,
......
90 88
    holder = CharField(max_length=4096)
91 89
    source = CharField(max_length=4096, null=True)
92 90
    resource = CharField(max_length=4096)
93
    limit = intDecimalField()
94
    usage_min = intDecimalField()
95
    usage_max = intDecimalField()
96
    delta_quantity = intDecimalField()
91
    limit = BigIntegerField()
92
    usage_min = BigIntegerField()
93
    usage_max = BigIntegerField()
94
    delta_quantity = BigIntegerField()
97 95
    reason = CharField(max_length=4096)

Also available in: Unified diff