Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / db / migrations / 0101_auto__add_field_network_subnet_ids.py @ 4e3789fd

History | View | Annotate | Download (19.6 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
        # Adding field 'Network.subnet_ids'
12
        db.add_column('db_network', 'subnet_ids',
13
                      self.gf('synnefo.db.fields.SeparatedValuesField')(null=True),
14
                      keep_default=False)
15

    
16

    
17
    def backwards(self, orm):
18
        # Deleting field 'Network.subnet_ids'
19
        db.delete_column('db_network', 'subnet_ids')
20

    
21

    
22
    models = {
23
        'db.backend': {
24
            'Meta': {'ordering': "['clustername']", 'object_name': 'Backend'},
25
            'clustername': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
26
            'ctotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
27
            'dfree': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
28
            'disk_templates': ('synnefo.db.fields.SeparatedValuesField', [], {'null': 'True'}),
29
            'drained': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
30
            'dtotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
31
            'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
32
            'hypervisor': ('django.db.models.fields.CharField', [], {'default': "'kvm'", 'max_length': '32'}),
33
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
34
            'index': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'unique': 'True'}),
35
            'mfree': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
36
            'mtotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
37
            'offline': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
38
            'password_hash': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
39
            'pinst_cnt': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
40
            'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
41
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
42
            'username': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
43
        },
44
        'db.backendnetwork': {
45
            'Meta': {'unique_together': "(('network', 'backend'),)", 'object_name': 'BackendNetwork'},
46
            'backend': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'networks'", 'on_delete': 'models.PROTECT', 'to': "orm['db.Backend']"}),
47
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
48
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
49
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
50
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
51
            'backendtime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1, 1, 1, 0, 0)'}),
52
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
53
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
54
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
55
            'mac_prefix': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
56
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'backend_networks'", 'on_delete': 'models.PROTECT', 'to': "orm['db.Network']"}),
57
            'operstate': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '30'}),
58
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
59
        },
60
        'db.bridgepooltable': {
61
            'Meta': {'object_name': 'BridgePoolTable'},
62
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
63
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
64
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
66
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
67
            'size': ('django.db.models.fields.IntegerField', [], {})
68
        },
69
        'db.flavor': {
70
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk', 'disk_template'),)", 'object_name': 'Flavor'},
71
            'allow_create': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
72
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
73
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
74
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
75
            'disk_template': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
76
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
77
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
78
        },
79
        'db.ipaddress': {
80
            'Meta': {'unique_together': "(('network', 'address', 'deleted'),)", 'object_name': 'IPAddress'},
81
            'address': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
82
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
83
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
84
            'floating_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
85
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
86
            'ipversion': ('django.db.models.fields.IntegerField', [], {}),
87
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ips'", 'on_delete': 'models.PROTECT', 'to': "orm['db.Network']"}),
88
            'nic': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ips'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['db.NetworkInterface']"}),
89
            'project': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
90
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ips'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['db.QuotaHolderSerial']"}),
91
            'subnet': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ips'", 'on_delete': 'models.PROTECT', 'to': "orm['db.Subnet']"}),
92
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
93
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'})
94
        },
95
        'db.ipaddresslog': {
96
            'Meta': {'object_name': 'IPAddressLog'},
97
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
98
            'address': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}),
99
            'allocated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
100
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
101
            'network_id': ('django.db.models.fields.IntegerField', [], {}),
102
            'released_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
103
            'server_id': ('django.db.models.fields.IntegerField', [], {})
104
        },
105
        'db.ippooltable': {
106
            'Meta': {'object_name': 'IPPoolTable'},
107
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
108
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
109
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
110
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
111
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
112
            'size': ('django.db.models.fields.IntegerField', [], {}),
113
            'subnet': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ip_pools'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['db.Subnet']"})
114
        },
115
        'db.macprefixpooltable': {
116
            'Meta': {'object_name': 'MacPrefixPoolTable'},
117
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
118
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
119
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
120
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
121
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
122
            'size': ('django.db.models.fields.IntegerField', [], {})
123
        },
124
        'db.network': {
125
            'Meta': {'object_name': 'Network'},
126
            'action': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}),
127
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
128
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
129
            'drained': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
130
            'external_router': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
131
            'flavor': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
132
            'floating_ip_pool': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
133
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
134
            'link': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
135
            'mac_prefix': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
136
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
137
            'mode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True'}),
138
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
139
            'project': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
140
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
141
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'network'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['db.QuotaHolderSerial']"}),
142
            'state': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '32'}),
143
            'subnet_ids': ('synnefo.db.fields.SeparatedValuesField', [], {'null': 'True'}),
144
            'tags': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
145
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
146
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
147
        },
148
        'db.networkinterface': {
149
            'Meta': {'object_name': 'NetworkInterface'},
150
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
151
            'device_owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
152
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
153
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
154
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
155
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}),
156
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['db.VirtualMachine']"}),
157
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'null': 'True'}),
158
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'on_delete': 'models.PROTECT', 'to': "orm['db.Network']"}),
159
            'security_groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.SecurityGroup']", 'null': 'True', 'symmetrical': 'False'}),
160
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '32'}),
161
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
162
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'})
163
        },
164
        'db.quotaholderserial': {
165
            'Meta': {'ordering': "['serial']", 'object_name': 'QuotaHolderSerial'},
166
            'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
167
            'pending': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
168
            'resolved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
169
            'serial': ('django.db.models.fields.BigIntegerField', [], {'primary_key': 'True', 'db_index': 'True'})
170
        },
171
        'db.securitygroup': {
172
            'Meta': {'object_name': 'SecurityGroup'},
173
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
174
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
175
        },
176
        'db.subnet': {
177
            'Meta': {'object_name': 'Subnet'},
178
            'cidr': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
179
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
180
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
181
            'dhcp': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
182
            'dns_nameservers': ('synnefo.db.fields.SeparatedValuesField', [], {'null': 'True'}),
183
            'gateway': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
184
            'host_routes': ('synnefo.db.fields.SeparatedValuesField', [], {'null': 'True'}),
185
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
186
            'ipversion': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
187
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'null': 'True'}),
188
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subnets'", 'on_delete': 'models.PROTECT', 'to': "orm['db.Network']"}),
189
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
190
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
191
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
192
        },
193
        'db.virtualmachine': {
194
            'Meta': {'object_name': 'VirtualMachine'},
195
            'action': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True'}),
196
            'backend': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'on_delete': 'models.PROTECT', 'to': "orm['db.Backend']"}),
197
            'backend_hash': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
198
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
199
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
200
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
201
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
202
            'backendtime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1, 1, 1, 0, 0)'}),
203
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
204
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
205
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
206
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']", 'on_delete': 'models.PROTECT'}),
207
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
208
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
209
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
210
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
211
            'operstate': ('django.db.models.fields.CharField', [], {'default': "'BUILD'", 'max_length': '30'}),
212
            'project': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
213
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machine'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['db.QuotaHolderSerial']"}),
214
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
215
            'task': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
216
            'task_job_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
217
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
218
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'})
219
        },
220
        'db.virtualmachinediagnostic': {
221
            'Meta': {'ordering': "['-created']", 'object_name': 'VirtualMachineDiagnostic'},
222
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
223
            'details': ('django.db.models.fields.TextField', [], {'null': 'True'}),
224
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
225
            'level': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
226
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'diagnostics'", 'to': "orm['db.VirtualMachine']"}),
227
            'message': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
228
            'source': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
229
            'source_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'})
230
        },
231
        'db.virtualmachinemetadata': {
232
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
233
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
234
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
235
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
236
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
237
        }
238
    }
239

    
240
    complete_apps = ['db']