Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / db / migrations / 0078_auto__del_field_network_subnet6__del_field_network_subnet__del_field_n.py @ 7b72b50d

History | View | Annotate | Download (18.8 kB)

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
        # Deleting field 'Network.subnet6'
12
        db.delete_column('db_network', 'subnet6')
13

    
14
        # Deleting field 'Network.subnet'
15
        db.delete_column('db_network', 'subnet')
16

    
17
        # Deleting field 'Network.gateway'
18
        db.delete_column('db_network', 'gateway')
19

    
20
        # Deleting field 'Network.dhcp'
21
        db.delete_column('db_network', 'dhcp')
22

    
23
        # Deleting field 'Network.pool'
24
        db.delete_column('db_network', 'pool_id')
25

    
26
        # Deleting field 'Network.gateway6'
27
        db.delete_column('db_network', 'gateway6')
28

    
29
        # Adding field 'Network.external_router'
30
        db.add_column('db_network', 'external_router',
31
                      self.gf('django.db.models.fields.BooleanField')(default=False),
32
                      keep_default=False)
33

    
34

    
35
    def backwards(self, orm):
36
        # Adding field 'Network.subnet6'
37
        db.add_column('db_network', 'subnet6',
38
                      self.gf('django.db.models.fields.CharField')(max_length=64, null=True),
39
                      keep_default=False)
40

    
41
        # Adding field 'Network.subnet'
42
        db.add_column('db_network', 'subnet',
43
                      self.gf('django.db.models.fields.CharField')(max_length=32, null=True),
44
                      keep_default=False)
45

    
46
        # Adding field 'Network.gateway'
47
        db.add_column('db_network', 'gateway',
48
                      self.gf('django.db.models.fields.CharField')(max_length=32, null=True),
49
                      keep_default=False)
50

    
51
        # Adding field 'Network.dhcp'
52
        db.add_column('db_network', 'dhcp',
53
                      self.gf('django.db.models.fields.BooleanField')(default=True),
54
                      keep_default=False)
55

    
56
        # Adding field 'Network.pool'
57
        db.add_column('db_network', 'pool',
58
                      self.gf('django.db.models.fields.related.OneToOneField')(related_name='network', unique=True, null=True, to=orm['db.IPPoolTable']),
59
                      keep_default=False)
60

    
61
        # Adding field 'Network.gateway6'
62
        db.add_column('db_network', 'gateway6',
63
                      self.gf('django.db.models.fields.CharField')(max_length=64, null=True),
64
                      keep_default=False)
65

    
66
        # Deleting field 'Network.external_router'
67
        db.delete_column('db_network', 'external_router')
68

    
69

    
70
    models = {
71
        'db.backend': {
72
            'Meta': {'ordering': "['clustername']", 'object_name': 'Backend'},
73
            'clustername': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
74
            'ctotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
75
            'dfree': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
76
            'disk_templates': ('synnefo.db.fields.SeparatedValuesField', [], {'null': 'True'}),
77
            'drained': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
78
            'dtotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
79
            'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
80
            'hypervisor': ('django.db.models.fields.CharField', [], {'default': "'kvm'", 'max_length': '32'}),
81
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
82
            'index': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'unique': 'True'}),
83
            'mfree': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
84
            'mtotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
85
            'offline': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
86
            'password_hash': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
87
            'pinst_cnt': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
88
            'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
89
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
90
            'username': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
91
        },
92
        'db.backendnetwork': {
93
            'Meta': {'unique_together': "(('network', 'backend'),)", 'object_name': 'BackendNetwork'},
94
            'backend': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'networks'", 'on_delete': 'models.PROTECT', 'to': "orm['db.Backend']"}),
95
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
96
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
97
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
98
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
99
            'backendtime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1, 1, 1, 0, 0)'}),
100
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
101
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
102
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
103
            'mac_prefix': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
104
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'backend_networks'", 'to': "orm['db.Network']"}),
105
            'operstate': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '30'}),
106
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
107
        },
108
        'db.bridgepooltable': {
109
            'Meta': {'object_name': 'BridgePoolTable'},
110
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
111
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
112
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
113
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
114
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
115
            'size': ('django.db.models.fields.IntegerField', [], {})
116
        },
117
        'db.flavor': {
118
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk', 'disk_template'),)", 'object_name': 'Flavor'},
119
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
120
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
121
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
122
            'disk_template': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
123
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
124
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
125
        },
126
        'db.floatingip': {
127
            'Meta': {'object_name': 'FloatingIP'},
128
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
129
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
130
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131
            'ipv4': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
132
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'floating_ips'", 'null': 'True', 'to': "orm['db.VirtualMachine']"}),
133
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'floating_ips'", 'to': "orm['db.Network']"}),
134
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'floating_ips'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['db.QuotaHolderSerial']"}),
135
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'})
136
        },
137
        'db.ippooltable': {
138
            'Meta': {'object_name': 'IPPoolTable'},
139
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
140
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
141
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
142
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
143
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
144
            'size': ('django.db.models.fields.IntegerField', [], {}),
145
            'subnet': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ip_pools'", 'null': 'True', 'to': "orm['db.Subnet']"})
146
        },
147
        'db.macprefixpooltable': {
148
            'Meta': {'object_name': 'MacPrefixPoolTable'},
149
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
150
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
151
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
152
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
153
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
154
            'size': ('django.db.models.fields.IntegerField', [], {})
155
        },
156
        'db.network': {
157
            'Meta': {'object_name': 'Network'},
158
            'action': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}),
159
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
160
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
161
            'drained': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
162
            'external_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
163
            'flavor': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
164
            'floating_ip_pool': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
165
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
166
            'link': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
167
            'mac_prefix': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
168
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
169
            'mode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True'}),
170
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
171
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
172
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'network'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['db.QuotaHolderSerial']"}),
173
            'state': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '32'}),
174
            'tags': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
175
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
176
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
177
        },
178
        'db.networkinterface': {
179
            'Meta': {'unique_together': "(('network', 'ipv4'),)", 'object_name': 'NetworkInterface'},
180
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
181
            'dirty': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
182
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
183
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
184
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
185
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
186
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
187
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}),
188
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
189
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
190
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '32'}),
191
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
192
        },
193
        'db.quotaholderserial': {
194
            'Meta': {'ordering': "['serial']", 'object_name': 'QuotaHolderSerial'},
195
            'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
196
            'pending': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
197
            'resolved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
198
            'serial': ('django.db.models.fields.BigIntegerField', [], {'primary_key': 'True', 'db_index': 'True'})
199
        },
200
        'db.subnet': {
201
            'Meta': {'object_name': 'Subnet'},
202
            'cidr': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
203
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
204
            'dhcp': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
205
            'dns_nameservers': ('synnefo.db.fields.SeparatedValuesField', [], {'null': 'True'}),
206
            'gateway': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
207
            'host_routes': ('synnefo.db.fields.SeparatedValuesField', [], {'null': 'True'}),
208
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
209
            'ipversion': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
210
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
211
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subnets'", 'to': "orm['db.Network']"})
212
        },
213
        'db.virtualmachine': {
214
            'Meta': {'object_name': 'VirtualMachine'},
215
            'action': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True'}),
216
            'backend': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['db.Backend']"}),
217
            'backend_hash': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
218
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
219
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
220
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
221
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
222
            'backendtime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1, 1, 1, 0, 0)'}),
223
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
224
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
225
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
226
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']", 'on_delete': 'models.PROTECT'}),
227
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
228
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
229
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
230
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
231
            'operstate': ('django.db.models.fields.CharField', [], {'default': "'BUILD'", 'max_length': '30'}),
232
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machine'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['db.QuotaHolderSerial']"}),
233
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
234
            'task': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
235
            'task_job_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
236
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
237
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'})
238
        },
239
        'db.virtualmachinediagnostic': {
240
            'Meta': {'ordering': "['-created']", 'object_name': 'VirtualMachineDiagnostic'},
241
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
242
            'details': ('django.db.models.fields.TextField', [], {'null': 'True'}),
243
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
244
            'level': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
245
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'diagnostics'", 'to': "orm['db.VirtualMachine']"}),
246
            'message': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
247
            'source': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
248
            'source_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'})
249
        },
250
        'db.virtualmachinemetadata': {
251
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
252
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
253
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
254
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
255
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
256
        }
257
    }
258

    
259
    complete_apps = ['db']