Revision e8d31c74

b/snf-cyclades-app/synnefo/db/migrations/0071_auto__chg_field_virtualmachine_task_job_id.py
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
        # Changing field 'VirtualMachine.task_job_id'
12
        db.alter_column('db_virtualmachine', 'task_job_id', self.gf('django.db.models.fields.BigIntegerField')(null=True))
13

  
14

  
15
    def backwards(self, orm):
16
        
17
        # Changing field 'VirtualMachine.task_job_id'
18
        db.alter_column('db_virtualmachine', 'task_job_id', self.gf('django.db.models.fields.BigIntegerField')(max_length=64, null=True))
19

  
20

  
21
    models = {
22
        'db.backend': {
23
            'Meta': {'ordering': "['clustername']", 'object_name': 'Backend'},
24
            'clustername': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
25
            'ctotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
26
            'dfree': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
27
            'drained': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
28
            'dtotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
29
            'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
30
            'hypervisor': ('django.db.models.fields.CharField', [], {'default': "'kvm'", 'max_length': '32'}),
31
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
32
            'index': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'unique': 'True'}),
33
            'mfree': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
34
            'mtotal': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
35
            'offline': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
36
            'password_hash': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
37
            'pinst_cnt': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
38
            'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
39
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
40
            'username': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
41
        },
42
        'db.backendnetwork': {
43
            'Meta': {'unique_together': "(('network', 'backend'),)", 'object_name': 'BackendNetwork'},
44
            'backend': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'networks'", 'to': "orm['db.Backend']"}),
45
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
46
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
47
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
48
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
49
            'backendtime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1, 1, 1, 0, 0)'}),
50
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
51
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
52
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
53
            'mac_prefix': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
54
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'backend_networks'", 'to': "orm['db.Network']"}),
55
            'operstate': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '30'}),
56
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
57
        },
58
        'db.bridgepooltable': {
59
            'Meta': {'object_name': 'BridgePoolTable'},
60
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
61
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
62
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
63
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
64
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
65
            'size': ('django.db.models.fields.IntegerField', [], {})
66
        },
67
        'db.flavor': {
68
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk', 'disk_template'),)", 'object_name': 'Flavor'},
69
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
70
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
71
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
72
            'disk_template': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
73
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
75
        },
76
        'db.floatingip': {
77
            'Meta': {'object_name': 'FloatingIP'},
78
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
79
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
80
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
81
            'ipv4': ('django.db.models.fields.IPAddressField', [], {'unique': 'True', 'max_length': '15', 'db_index': 'True'}),
82
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'floating_ips'", 'null': 'True', 'to': "orm['db.VirtualMachine']"}),
83
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'floating_ips'", 'to': "orm['db.Network']"}),
84
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'floating_ips'", 'null': 'True', 'to': "orm['db.QuotaHolderSerial']"}),
85
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'})
86
        },
87
        'db.ippooltable': {
88
            'Meta': {'object_name': 'IPPoolTable'},
89
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
90
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
91
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
92
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
93
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
94
            'size': ('django.db.models.fields.IntegerField', [], {})
95
        },
96
        'db.macprefixpooltable': {
97
            'Meta': {'object_name': 'MacPrefixPoolTable'},
98
            'available_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
99
            'base': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
100
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
101
            'offset': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
102
            'reserved_map': ('django.db.models.fields.TextField', [], {'default': "''"}),
103
            'size': ('django.db.models.fields.IntegerField', [], {})
104
        },
105
        'db.network': {
106
            'Meta': {'object_name': 'Network'},
107
            'action': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '32', 'null': 'True'}),
108
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
109
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
110
            'dhcp': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
111
            'drained': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
112
            'flavor': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
113
            'floating_ip_pool': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
114
            'gateway': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
115
            'gateway6': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
116
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
117
            'link': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
118
            'mac_prefix': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
119
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
120
            'mode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True'}),
121
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
122
            'pool': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'network'", 'unique': 'True', 'null': 'True', 'to': "orm['db.IPPoolTable']"}),
123
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
124
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'network'", 'null': 'True', 'to': "orm['db.QuotaHolderSerial']"}),
125
            'state': ('django.db.models.fields.CharField', [], {'default': "'PENDING'", 'max_length': '32'}),
126
            'subnet': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
127
            'subnet6': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
128
            'tags': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
129
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
130
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
131
        },
132
        'db.networkinterface': {
133
            'Meta': {'object_name': 'NetworkInterface'},
134
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
135
            'dirty': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
136
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
137
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
138
            'index': ('django.db.models.fields.IntegerField', [], {}),
139
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
140
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
141
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}),
142
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
143
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
144
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '32'}),
145
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
146
        },
147
        'db.quotaholderserial': {
148
            'Meta': {'ordering': "['serial']", 'object_name': 'QuotaHolderSerial'},
149
            'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
150
            'pending': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
151
            'resolved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
152
            'serial': ('django.db.models.fields.BigIntegerField', [], {'primary_key': 'True', 'db_index': 'True'})
153
        },
154
        'db.virtualmachine': {
155
            'Meta': {'object_name': 'VirtualMachine'},
156
            'action': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True'}),
157
            'backend': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'to': "orm['db.Backend']"}),
158
            'backend_hash': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
159
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
160
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
161
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
162
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
163
            'backendtime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1, 1, 1, 0, 0)'}),
164
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
165
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
166
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
167
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
168
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
169
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
170
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
171
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
172
            'operstate': ('django.db.models.fields.CharField', [], {'default': "'BUILD'", 'max_length': '30'}),
173
            'serial': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machine'", 'null': 'True', 'to': "orm['db.QuotaHolderSerial']"}),
174
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
175
            'task': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
176
            'task_job_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
177
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
178
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'})
179
        },
180
        'db.virtualmachinediagnostic': {
181
            'Meta': {'ordering': "['-created']", 'object_name': 'VirtualMachineDiagnostic'},
182
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
183
            'details': ('django.db.models.fields.TextField', [], {'null': 'True'}),
184
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
185
            'level': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
186
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'diagnostics'", 'to': "orm['db.VirtualMachine']"}),
187
            'message': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
188
            'source': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
189
            'source_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'})
190
        },
191
        'db.virtualmachinemetadata': {
192
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
193
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
194
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
195
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
196
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
197
        }
198
    }
199

  
200
    complete_apps = ['db']
b/snf-cyclades-app/synnefo/db/models.py
357 357
    # Latest action and corresponding Ganeti job ID, for actions issued
358 358
    # by the API
359 359
    task = models.CharField(max_length=64, null=True)
360
    task_job_id = models.BigIntegerField(max_length=64, null=True)
360
    task_job_id = models.BigIntegerField(null=True)
361 361

  
362 362
    objects = ForUpdateManager()
363 363

  

Also available in: Unified diff