Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / quotaholder_app / migrations / 0004_auto__del_holder__del_callserial__del_unique_callserial_serial_clientk.py @ e1feace1

History | View | Annotate | Download (17.8 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
        # Removing unique constraint on 'Holding', fields ['resource', 'entity']
12
        db.delete_unique('quotaholder_app_holding', ['resource', 'entity_id'])
13

    
14
        # Removing unique constraint on 'CallSerial', fields ['serial', 'clientkey']
15
        db.delete_unique('quotaholder_app_callserial', ['serial', 'clientkey'])
16

    
17
        # Deleting model 'Holder'
18
        db.delete_table('quotaholder_app_holder')
19

    
20
        # Deleting model 'CallSerial'
21
        db.delete_table('quotaholder_app_callserial')
22

    
23
        # Deleting model 'Entity'
24
        db.delete_table('quotaholder_app_entity')
25

    
26
        # Deleting model 'Policy'
27
        db.delete_table('quotaholder_app_policy')
28

    
29
        # Deleting field 'ProvisionLog.target_released'
30
        db.delete_column('quotaholder_app_provisionlog', 'target_released')
31

    
32
        # Deleting field 'ProvisionLog.target_returned'
33
        db.delete_column('quotaholder_app_provisionlog', 'target_returned')
34

    
35
        # Deleting field 'ProvisionLog.source_quantity'
36
        db.delete_column('quotaholder_app_provisionlog', 'source_quantity')
37

    
38
        # Deleting field 'ProvisionLog.target_quantity'
39
        db.delete_column('quotaholder_app_provisionlog', 'target_quantity')
40

    
41
        # Deleting field 'ProvisionLog.target_exported'
42
        db.delete_column('quotaholder_app_provisionlog', 'target_exported')
43

    
44
        # Deleting field 'ProvisionLog.target_import_limit'
45
        db.delete_column('quotaholder_app_provisionlog', 'target_import_limit')
46

    
47
        # Deleting field 'ProvisionLog.target_capacity'
48
        db.delete_column('quotaholder_app_provisionlog', 'target_capacity')
49

    
50
        # Deleting field 'ProvisionLog.source_capacity'
51
        db.delete_column('quotaholder_app_provisionlog', 'source_capacity')
52

    
53
        # Deleting field 'ProvisionLog.source_returned'
54
        db.delete_column('quotaholder_app_provisionlog', 'source_returned')
55

    
56
        # Deleting field 'ProvisionLog.target_export_limit'
57
        db.delete_column('quotaholder_app_provisionlog', 'target_export_limit')
58

    
59
        # Deleting field 'ProvisionLog.source_released'
60
        db.delete_column('quotaholder_app_provisionlog', 'source_released')
61

    
62
        # Deleting field 'ProvisionLog.target'
63
        db.delete_column('quotaholder_app_provisionlog', 'target')
64

    
65
        # Deleting field 'ProvisionLog.source_export_limit'
66
        db.delete_column('quotaholder_app_provisionlog', 'source_export_limit')
67

    
68
        # Deleting field 'ProvisionLog.source_exported'
69
        db.delete_column('quotaholder_app_provisionlog', 'source_exported')
70

    
71
        # Deleting field 'ProvisionLog.source_import_limit'
72
        db.delete_column('quotaholder_app_provisionlog', 'source_import_limit')
73

    
74
        # Deleting field 'ProvisionLog.target_imported'
75
        db.delete_column('quotaholder_app_provisionlog', 'target_imported')
76

    
77
        # Deleting field 'ProvisionLog.source_imported'
78
        db.delete_column('quotaholder_app_provisionlog', 'source_imported')
79

    
80
        # Changing field 'ProvisionLog.source'
81
        db.alter_column('quotaholder_app_provisionlog', 'source', self.gf('django.db.models.fields.CharField')(max_length=4096, null=True))
82

    
83
        # Deleting field 'Commission.entity'
84
        db.delete_column('quotaholder_app_commission', 'entity_id')
85

    
86
        # Changing field 'Commission.name'
87
        db.alter_column('quotaholder_app_commission', 'name', self.gf('django.db.models.fields.CharField')(max_length=4096))
88

    
89
        # Deleting field 'Holding.imported'
90
        db.delete_column('quotaholder_app_holding', 'imported')
91

    
92
        # Deleting field 'Holding.returned'
93
        db.delete_column('quotaholder_app_holding', 'returned')
94

    
95
        # Deleting field 'Holding.released'
96
        db.delete_column('quotaholder_app_holding', 'released')
97

    
98
        # Deleting field 'Holding.releasing'
99
        db.delete_column('quotaholder_app_holding', 'releasing')
100

    
101
        # Deleting field 'Holding.entity'
102
        db.delete_column('quotaholder_app_holding', 'entity_id')
103

    
104
        # Deleting field 'Holding.policy'
105
        db.delete_column('quotaholder_app_holding', 'policy_id')
106

    
107
        # Deleting field 'Holding.flags'
108
        db.delete_column('quotaholder_app_holding', 'flags')
109

    
110
        # Deleting field 'Holding.exported'
111
        db.delete_column('quotaholder_app_holding', 'exported')
112

    
113
        # Deleting field 'Holding.exporting'
114
        db.delete_column('quotaholder_app_holding', 'exporting')
115

    
116
        # Deleting field 'Holding.importing'
117
        db.delete_column('quotaholder_app_holding', 'importing')
118

    
119
        # Deleting field 'Holding.returning'
120
        db.delete_column('quotaholder_app_holding', 'returning')
121

    
122
        # Adding unique constraint on 'Holding', fields ['resource', 'source', 'holder']
123
        db.create_unique('quotaholder_app_holding', ['resource', 'source', 'holder'])
124

    
125
        # Deleting field 'Provision.entity'
126
        db.delete_column('quotaholder_app_provision', 'entity_id')
127

    
128

    
129
    def backwards(self, orm):
130
        
131
        # Removing unique constraint on 'Holding', fields ['resource', 'source', 'holder']
132
        db.delete_unique('quotaholder_app_holding', ['resource', 'source', 'holder'])
133

    
134
        # Adding model 'Holder'
135
        db.create_table('quotaholder_app_holder', (
136
            ('attribute', self.gf('django.db.models.fields.CharField')(max_length=4096, primary_key=True)),
137
            ('strval', self.gf('django.db.models.fields.CharField')(max_length=4096)),
138
            ('intval', self.gf('django.db.models.fields.BigIntegerField')()),
139
        ))
140
        db.send_create_signal('quotaholder_app', ['Holder'])
141

    
142
        # Adding model 'CallSerial'
143
        db.create_table('quotaholder_app_callserial', (
144
            ('serial', self.gf('django.db.models.fields.BigIntegerField')()),
145
            ('clientkey', self.gf('django.db.models.fields.CharField')(max_length=4096)),
146
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
147
        ))
148
        db.send_create_signal('quotaholder_app', ['CallSerial'])
149

    
150
        # Adding unique constraint on 'CallSerial', fields ['serial', 'clientkey']
151
        db.create_unique('quotaholder_app_callserial', ['serial', 'clientkey'])
152

    
153
        # Adding model 'Entity'
154
        db.create_table('quotaholder_app_entity', (
155
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='entities', to=orm['quotaholder_app.Entity'])),
156
            ('key', self.gf('django.db.models.fields.CharField')(max_length=4096)),
157
            ('entity', self.gf('django.db.models.fields.CharField')(max_length=4096, primary_key=True)),
158
        ))
159
        db.send_create_signal('quotaholder_app', ['Entity'])
160

    
161
        # Adding model 'Policy'
162
        db.create_table('quotaholder_app_policy', (
163
            ('capacity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)),
164
            ('import_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)),
165
            ('export_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)),
166
            ('policy', self.gf('django.db.models.fields.CharField')(max_length=4096, primary_key=True)),
167
            ('quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)),
168
        ))
169
        db.send_create_signal('quotaholder_app', ['Policy'])
170

    
171
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_released'
172
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_released' and its values cannot be restored.")
173

    
174
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_returned'
175
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_returned' and its values cannot be restored.")
176

    
177
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_quantity'
178
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_quantity' and its values cannot be restored.")
179

    
180
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_quantity'
181
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_quantity' and its values cannot be restored.")
182

    
183
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_exported'
184
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_exported' and its values cannot be restored.")
185

    
186
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_import_limit'
187
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_import_limit' and its values cannot be restored.")
188

    
189
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_capacity'
190
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_capacity' and its values cannot be restored.")
191

    
192
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_capacity'
193
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_capacity' and its values cannot be restored.")
194

    
195
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_returned'
196
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_returned' and its values cannot be restored.")
197

    
198
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_export_limit'
199
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_export_limit' and its values cannot be restored.")
200

    
201
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_released'
202
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_released' and its values cannot be restored.")
203

    
204
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target'
205
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target' and its values cannot be restored.")
206

    
207
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_export_limit'
208
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_export_limit' and its values cannot be restored.")
209

    
210
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_exported'
211
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_exported' and its values cannot be restored.")
212

    
213
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_import_limit'
214
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_import_limit' and its values cannot be restored.")
215

    
216
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.target_imported'
217
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.target_imported' and its values cannot be restored.")
218

    
219
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source_imported'
220
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source_imported' and its values cannot be restored.")
221

    
222
        # User chose to not deal with backwards NULL issues for 'ProvisionLog.source'
223
        raise RuntimeError("Cannot reverse this migration. 'ProvisionLog.source' and its values cannot be restored.")
224

    
225
        # User chose to not deal with backwards NULL issues for 'Commission.entity'
226
        raise RuntimeError("Cannot reverse this migration. 'Commission.entity' and its values cannot be restored.")
227

    
228
        # Changing field 'Commission.name'
229
        db.alter_column('quotaholder_app_commission', 'name', self.gf('django.db.models.fields.CharField')(max_length=4096, null=True))
230

    
231
        # Adding field 'Holding.imported'
232
        db.add_column('quotaholder_app_holding', 'imported', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
233

    
234
        # Adding field 'Holding.returned'
235
        db.add_column('quotaholder_app_holding', 'returned', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
236

    
237
        # Adding field 'Holding.released'
238
        db.add_column('quotaholder_app_holding', 'released', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
239

    
240
        # Adding field 'Holding.releasing'
241
        db.add_column('quotaholder_app_holding', 'releasing', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
242

    
243
        # User chose to not deal with backwards NULL issues for 'Holding.entity'
244
        raise RuntimeError("Cannot reverse this migration. 'Holding.entity' and its values cannot be restored.")
245

    
246
        # User chose to not deal with backwards NULL issues for 'Holding.policy'
247
        raise RuntimeError("Cannot reverse this migration. 'Holding.policy' and its values cannot be restored.")
248

    
249
        # Adding field 'Holding.flags'
250
        db.add_column('quotaholder_app_holding', 'flags', self.gf('django.db.models.fields.BigIntegerField')(default=0), keep_default=False)
251

    
252
        # Adding field 'Holding.exported'
253
        db.add_column('quotaholder_app_holding', 'exported', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
254

    
255
        # Adding field 'Holding.exporting'
256
        db.add_column('quotaholder_app_holding', 'exporting', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
257

    
258
        # Adding field 'Holding.importing'
259
        db.add_column('quotaholder_app_holding', 'importing', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
260

    
261
        # Adding field 'Holding.returning'
262
        db.add_column('quotaholder_app_holding', 'returning', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0), keep_default=False)
263

    
264
        # Adding unique constraint on 'Holding', fields ['resource', 'entity']
265
        db.create_unique('quotaholder_app_holding', ['resource', 'entity_id'])
266

    
267
        # User chose to not deal with backwards NULL issues for 'Provision.entity'
268
        raise RuntimeError("Cannot reverse this migration. 'Provision.entity' and its values cannot be restored.")
269

    
270

    
271
    models = {
272
        'quotaholder_app.commission': {
273
            'Meta': {'object_name': 'Commission'},
274
            'clientkey': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
275
            'issue_time': ('django.db.models.fields.CharField', [], {'max_length': '24'}),
276
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '4096'}),
277
            'serial': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
278
        },
279
        'quotaholder_app.holding': {
280
            'Meta': {'unique_together': "(('holder', 'source', 'resource'),)", 'object_name': 'Holding'},
281
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'db_index': 'True'}),
282
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
283
            'limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
284
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
285
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
286
            'usage_max': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}),
287
            'usage_min': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'})
288
        },
289
        'quotaholder_app.provision': {
290
            'Meta': {'object_name': 'Provision'},
291
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'db_index': 'True'}),
292
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
293
            'quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
294
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
295
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'provisions'", 'to': "orm['quotaholder_app.Commission']"}),
296
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'})
297
        },
298
        'quotaholder_app.provisionlog': {
299
            'Meta': {'object_name': 'ProvisionLog'},
300
            'delta_quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
301
            'holder': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
302
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
303
            'issue_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
304
            'limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
305
            'log_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
306
            'name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
307
            'reason': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
308
            'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
309
            'serial': ('django.db.models.fields.BigIntegerField', [], {}),
310
            'source': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
311
            'usage_max': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}),
312
            'usage_min': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'})
313
        }
314
    }
315

    
316
    complete_apps = ['quotaholder_app']