root / snf-astakos-app / astakos / quotaholder_app / migrations / 0001_initial.py @ 398a9604
History | View | Annotate | Download (17.3 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 'Holder'
|
12 |
db.create_table('quotaholder_app_holder', (
|
13 |
('attribute', self.gf('django.db.models.fields.CharField')(max_length=4096, primary_key=True)), |
14 |
('intval', self.gf('django.db.models.fields.BigIntegerField')()), |
15 |
('strval', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
16 |
)) |
17 |
db.send_create_signal('quotaholder_app', ['Holder']) |
18 |
|
19 |
# Adding model 'Entity'
|
20 |
db.create_table('quotaholder_app_entity', (
|
21 |
('entity', self.gf('django.db.models.fields.CharField')(max_length=4096, primary_key=True)), |
22 |
('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='entities', to=orm['quotaholder_app.Entity'])), |
23 |
('key', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
24 |
)) |
25 |
db.send_create_signal('quotaholder_app', ['Entity']) |
26 |
|
27 |
# Adding model 'Policy'
|
28 |
db.create_table('quotaholder_app_policy', (
|
29 |
('policy', self.gf('django.db.models.fields.CharField')(max_length=4096, primary_key=True)), |
30 |
('quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
31 |
('capacity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
32 |
('import_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
33 |
('export_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
34 |
)) |
35 |
db.send_create_signal('quotaholder_app', ['Policy']) |
36 |
|
37 |
# Adding model 'Holding'
|
38 |
db.create_table('quotaholder_app_holding', (
|
39 |
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), |
40 |
('entity', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['quotaholder_app.Entity'])), |
41 |
('resource', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
42 |
('policy', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['quotaholder_app.Policy'])), |
43 |
('flags', self.gf('django.db.models.fields.BigIntegerField')(default=0)), |
44 |
('imported', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
45 |
('importing', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
46 |
('exported', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
47 |
('exporting', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
48 |
('returned', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
49 |
('returning', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
50 |
('released', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
51 |
('releasing', self.gf('snf_django.lib.db.fields.IntDecimalField')(default=0, max_digits=38, decimal_places=0)), |
52 |
)) |
53 |
db.send_create_signal('quotaholder_app', ['Holding']) |
54 |
|
55 |
# Adding unique constraint on 'Holding', fields ['entity', 'resource']
|
56 |
db.create_unique('quotaholder_app_holding', ['entity_id', 'resource']) |
57 |
|
58 |
# Adding model 'Commission'
|
59 |
db.create_table('quotaholder_app_commission', (
|
60 |
('serial', self.gf('django.db.models.fields.AutoField')(primary_key=True)), |
61 |
('entity', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['quotaholder_app.Entity'])), |
62 |
('name', self.gf('django.db.models.fields.CharField')(max_length=4096, null=True)), |
63 |
('clientkey', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
64 |
('issue_time', self.gf('django.db.models.fields.CharField')(default='2013-04-26T11:03:12.0078', max_length=24)), |
65 |
)) |
66 |
db.send_create_signal('quotaholder_app', ['Commission']) |
67 |
|
68 |
# Adding model 'Provision'
|
69 |
db.create_table('quotaholder_app_provision', (
|
70 |
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), |
71 |
('serial', self.gf('django.db.models.fields.related.ForeignKey')(related_name='provisions', to=orm['quotaholder_app.Commission'])), |
72 |
('entity', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['quotaholder_app.Entity'])), |
73 |
('resource', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
74 |
('quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
75 |
)) |
76 |
db.send_create_signal('quotaholder_app', ['Provision']) |
77 |
|
78 |
# Adding model 'ProvisionLog'
|
79 |
db.create_table('quotaholder_app_provisionlog', (
|
80 |
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), |
81 |
('serial', self.gf('django.db.models.fields.BigIntegerField')()), |
82 |
('source', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
83 |
('target', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
84 |
('name', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
85 |
('issue_time', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
86 |
('log_time', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
87 |
('resource', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
88 |
('source_quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
89 |
('source_capacity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
90 |
('source_import_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
91 |
('source_export_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
92 |
('source_imported', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
93 |
('source_exported', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
94 |
('source_returned', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
95 |
('source_released', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
96 |
('target_quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
97 |
('target_capacity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
98 |
('target_import_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
99 |
('target_export_limit', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
100 |
('target_imported', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
101 |
('target_exported', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
102 |
('target_returned', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
103 |
('target_released', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
104 |
('delta_quantity', self.gf('snf_django.lib.db.fields.IntDecimalField')(max_digits=38, decimal_places=0)), |
105 |
('reason', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
106 |
)) |
107 |
db.send_create_signal('quotaholder_app', ['ProvisionLog']) |
108 |
|
109 |
# Adding model 'CallSerial'
|
110 |
db.create_table('quotaholder_app_callserial', (
|
111 |
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), |
112 |
('serial', self.gf('django.db.models.fields.BigIntegerField')()), |
113 |
('clientkey', self.gf('django.db.models.fields.CharField')(max_length=4096)), |
114 |
)) |
115 |
db.send_create_signal('quotaholder_app', ['CallSerial']) |
116 |
|
117 |
# Adding unique constraint on 'CallSerial', fields ['serial', 'clientkey']
|
118 |
db.create_unique('quotaholder_app_callserial', ['serial', 'clientkey']) |
119 |
|
120 |
|
121 |
def backwards(self, orm): |
122 |
|
123 |
# Removing unique constraint on 'CallSerial', fields ['serial', 'clientkey']
|
124 |
db.delete_unique('quotaholder_app_callserial', ['serial', 'clientkey']) |
125 |
|
126 |
# Removing unique constraint on 'Holding', fields ['entity', 'resource']
|
127 |
db.delete_unique('quotaholder_app_holding', ['entity_id', 'resource']) |
128 |
|
129 |
# Deleting model 'Holder'
|
130 |
db.delete_table('quotaholder_app_holder')
|
131 |
|
132 |
# Deleting model 'Entity'
|
133 |
db.delete_table('quotaholder_app_entity')
|
134 |
|
135 |
# Deleting model 'Policy'
|
136 |
db.delete_table('quotaholder_app_policy')
|
137 |
|
138 |
# Deleting model 'Holding'
|
139 |
db.delete_table('quotaholder_app_holding')
|
140 |
|
141 |
# Deleting model 'Commission'
|
142 |
db.delete_table('quotaholder_app_commission')
|
143 |
|
144 |
# Deleting model 'Provision'
|
145 |
db.delete_table('quotaholder_app_provision')
|
146 |
|
147 |
# Deleting model 'ProvisionLog'
|
148 |
db.delete_table('quotaholder_app_provisionlog')
|
149 |
|
150 |
# Deleting model 'CallSerial'
|
151 |
db.delete_table('quotaholder_app_callserial')
|
152 |
|
153 |
|
154 |
models = { |
155 |
'quotaholder_app.callserial': {
|
156 |
'Meta': {'unique_together': "(('serial', 'clientkey'),)", 'object_name': 'CallSerial'}, |
157 |
'clientkey': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
158 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
159 |
'serial': ('django.db.models.fields.BigIntegerField', [], {}) |
160 |
}, |
161 |
'quotaholder_app.commission': {
|
162 |
'Meta': {'object_name': 'Commission'}, |
163 |
'clientkey': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
164 |
'entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['quotaholder_app.Entity']"}), |
165 |
'issue_time': ('django.db.models.fields.CharField', [], {'default': "'2013-04-26T11:03:12.0120'", 'max_length': '24'}), |
166 |
'name': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}), |
167 |
'serial': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) |
168 |
}, |
169 |
'quotaholder_app.entity': {
|
170 |
'Meta': {'object_name': 'Entity'}, |
171 |
'entity': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'primary_key': 'True'}), |
172 |
'key': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
173 |
'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['quotaholder_app.Entity']"}) |
174 |
}, |
175 |
'quotaholder_app.holder': {
|
176 |
'Meta': {'object_name': 'Holder'}, |
177 |
'attribute': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'primary_key': 'True'}), |
178 |
'intval': ('django.db.models.fields.BigIntegerField', [], {}), |
179 |
'strval': ('django.db.models.fields.CharField', [], {'max_length': '4096'}) |
180 |
}, |
181 |
'quotaholder_app.holding': {
|
182 |
'Meta': {'unique_together': "(('entity', 'resource'),)", 'object_name': 'Holding'}, |
183 |
'entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['quotaholder_app.Entity']"}), |
184 |
'exported': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}), |
185 |
'exporting': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}), |
186 |
'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}), |
187 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
188 |
'imported': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}), |
189 |
'importing': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}), |
190 |
'policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['quotaholder_app.Policy']"}), |
191 |
'released': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}), |
192 |
'releasing': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}), |
193 |
'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
194 |
'returned': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}), |
195 |
'returning': ('snf_django.lib.db.fields.IntDecimalField', [], {'default': '0', 'max_digits': '38', 'decimal_places': '0'}) |
196 |
}, |
197 |
'quotaholder_app.policy': {
|
198 |
'Meta': {'object_name': 'Policy'}, |
199 |
'capacity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
200 |
'export_limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
201 |
'import_limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
202 |
'policy': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'primary_key': 'True'}), |
203 |
'quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}) |
204 |
}, |
205 |
'quotaholder_app.provision': {
|
206 |
'Meta': {'object_name': 'Provision'}, |
207 |
'entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['quotaholder_app.Entity']"}), |
208 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
209 |
'quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
210 |
'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
211 |
'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'provisions'", 'to': "orm['quotaholder_app.Commission']"}) |
212 |
}, |
213 |
'quotaholder_app.provisionlog': {
|
214 |
'Meta': {'object_name': 'ProvisionLog'}, |
215 |
'delta_quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
216 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
217 |
'issue_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
218 |
'log_time': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
219 |
'name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
220 |
'reason': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
221 |
'resource': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
222 |
'serial': ('django.db.models.fields.BigIntegerField', [], {}), |
223 |
'source': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
224 |
'source_capacity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
225 |
'source_export_limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
226 |
'source_exported': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
227 |
'source_import_limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
228 |
'source_imported': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
229 |
'source_quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
230 |
'source_released': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
231 |
'source_returned': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
232 |
'target': ('django.db.models.fields.CharField', [], {'max_length': '4096'}), |
233 |
'target_capacity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
234 |
'target_export_limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
235 |
'target_exported': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
236 |
'target_import_limit': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
237 |
'target_imported': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
238 |
'target_quantity': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
239 |
'target_released': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}), |
240 |
'target_returned': ('snf_django.lib.db.fields.IntDecimalField', [], {'max_digits': '38', 'decimal_places': '0'}) |
241 |
} |
242 |
} |
243 |
|
244 |
complete_apps = ['quotaholder_app']
|