Revision 9290cfab

/dev/null
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
        # Deleting model 'FlavorCost'
12
        db.delete_table('db_flavorcost')
13

  
14
        # Deleting model 'Invitations'
15
        db.delete_table('db_invitations')
16

  
17
        # Deleting model 'VirtualMachineGroup'
18
        db.delete_table('db_virtualmachinegroup')
19

  
20
        # Removing M2M table for field machines on 'VirtualMachineGroup'
21
        db.delete_table('db_virtualmachinegroup_machines')
22

  
23
        # Deleting model 'Limit'
24
        db.delete_table('db_limit')
25

  
26
        # Deleting model 'Debit'
27
        db.delete_table('db_debit')
28

  
29
        # Deleting field 'SynnefoUser.credit'
30
        db.delete_column('db_synnefouser', 'credit')
31

  
32
        # Deleting field 'SynnefoUser.max_invitations'
33
        db.delete_column('db_synnefouser', 'max_invitations')
34

  
35

  
36
    def backwards(self, orm):
37
        
38
        # Adding model 'FlavorCost'
39
        db.create_table('db_flavorcost', (
40
            ('cost_active', self.gf('django.db.models.fields.PositiveIntegerField')()),
41
            ('effective_from', self.gf('django.db.models.fields.DateTimeField')()),
42
            ('flavor', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.Flavor'])),
43
            ('cost_inactive', self.gf('django.db.models.fields.PositiveIntegerField')()),
44
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
45
        ))
46
        db.send_create_signal('db', ['FlavorCost'])
47

  
48
        # Adding model 'Invitations'
49
        db.create_table('db_invitations', (
50
            ('source', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['db.SynnefoUser'])),
51
            ('level', self.gf('django.db.models.fields.IntegerField')(null=True)),
52
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
53
            ('target', self.gf('django.db.models.fields.related.ForeignKey')(related_name='target', to=orm['db.SynnefoUser'])),
54
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
55
            ('accepted', self.gf('django.db.models.fields.BooleanField')(default=False)),
56
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
57
        ))
58
        db.send_create_signal('db', ['Invitations'])
59

  
60
        # Adding model 'VirtualMachineGroup'
61
        db.create_table('db_virtualmachinegroup', (
62
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
63
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
64
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
65
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'])),
66
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
67
        ))
68
        db.send_create_signal('db', ['VirtualMachineGroup'])
69

  
70
        # Adding M2M table for field machines on 'VirtualMachineGroup'
71
        db.create_table('db_virtualmachinegroup_machines', (
72
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
73
            ('virtualmachinegroup', models.ForeignKey(orm['db.virtualmachinegroup'], null=False)),
74
            ('virtualmachine', models.ForeignKey(orm['db.virtualmachine'], null=False))
75
        ))
76
        db.create_unique('db_virtualmachinegroup_machines', ['virtualmachinegroup_id', 'virtualmachine_id'])
77

  
78
        # Adding model 'Limit'
79
        db.create_table('db_limit', (
80
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'])),
81
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
82
            ('value', self.gf('django.db.models.fields.IntegerField')()),
83
            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)),
84
        ))
85
        db.send_create_signal('db', ['Limit'])
86

  
87
        # Adding model 'Debit'
88
        db.create_table('db_debit', (
89
            ('description', self.gf('django.db.models.fields.TextField')()),
90
            ('when', self.gf('django.db.models.fields.DateTimeField')()),
91
            ('vm', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.VirtualMachine'])),
92
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'])),
93
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
94
        ))
95
        db.send_create_signal('db', ['Debit'])
96

  
97
        # Adding field 'SynnefoUser.credit'
98
        db.add_column('db_synnefouser', 'credit', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
99

  
100
        # Adding field 'SynnefoUser.max_invitations'
101
        db.add_column('db_synnefouser', 'max_invitations', self.gf('django.db.models.fields.IntegerField')(null=True), keep_default=False)
102

  
103

  
104
    models = {
105
        'db.disk': {
106
            'Meta': {'object_name': 'Disk'},
107
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
108
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
109
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
110
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
111
            'size': ('django.db.models.fields.PositiveIntegerField', [], {}),
112
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
113
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True', 'blank': 'True'})
114
        },
115
        'db.flavor': {
116
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
117
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
118
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
119
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
120
            'disk_template': ('django.db.models.fields.CharField', [], {'default': "'drbd'", 'max_length': '32'}),
121
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
123
        },
124
        'db.image': {
125
            'Meta': {'object_name': 'Image'},
126
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
127
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
128
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
129
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
130
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
131
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
132
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
133
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
134
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
135
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
136
        },
137
        'db.imagemetadata': {
138
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
139
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
140
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
141
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
142
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
143
        },
144
        'db.network': {
145
            'Meta': {'object_name': 'Network'},
146
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
147
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
148
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
149
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
150
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
151
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True'}),
152
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
153
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
154
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
155
        },
156
        'db.networkinterface': {
157
            'Meta': {'object_name': 'NetworkInterface'},
158
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
159
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
160
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
161
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
162
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
163
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
164
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
165
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
166
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
167
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
168
        },
169
        'db.networklink': {
170
            'Meta': {'object_name': 'NetworkLink'},
171
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
172
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
173
            'index': ('django.db.models.fields.IntegerField', [], {}),
174
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
175
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
176
        },
177
        'db.synnefouser': {
178
            'Meta': {'object_name': 'SynnefoUser'},
179
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
180
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
181
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
182
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
183
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
184
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
185
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
186
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '30'}),
187
            'tmp_auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
188
            'tmp_auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
189
            'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
190
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
191
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
192
        },
193
        'db.virtualmachine': {
194
            'Meta': {'object_name': 'VirtualMachine'},
195
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
196
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
197
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
198
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
199
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
200
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
201
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 1, 23, 14, 29, 44, 160884)'}),
202
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
203
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
204
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
205
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
206
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
207
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
208
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
209
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
210
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
211
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
212
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
213
        },
214
        'db.virtualmachinemetadata': {
215
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
216
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
217
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
218
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
219
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
220
        }
221
    }
222

  
223
    complete_apps = ['db']
/dev/null
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
        # Deleting model 'Disk'
12
        db.delete_table('db_disk')
13

  
14
        # Adding field 'VirtualMachine.userid'
15
        db.add_column('db_virtualmachine', 'userid', self.gf('django.db.models.fields.CharField')(default='', max_length=100), keep_default=False)
16

  
17
        # Adding field 'Image.userid'
18
        db.add_column('db_image', 'userid', self.gf('django.db.models.fields.CharField')(default='', max_length=100), keep_default=False)
19

  
20
        # Adding field 'Network.userid'
21
        db.add_column('db_network', 'userid', self.gf('django.db.models.fields.CharField')(default='', max_length=100), keep_default=False)
22

  
23

  
24
    def backwards(self, orm):
25
        
26
        # Adding model 'Disk'
27
        db.create_table('db_disk', (
28
            ('vm', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.VirtualMachine'], null=True, blank=True)),
29
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
30
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
31
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
32
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'], null=True, blank=True)),
33
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
34
            ('size', self.gf('django.db.models.fields.PositiveIntegerField')()),
35
        ))
36
        db.send_create_signal('db', ['Disk'])
37

  
38
        # Deleting field 'VirtualMachine.userid'
39
        db.delete_column('db_virtualmachine', 'userid')
40

  
41
        # Deleting field 'Image.userid'
42
        db.delete_column('db_image', 'userid')
43

  
44
        # Deleting field 'Network.userid'
45
        db.delete_column('db_network', 'userid')
46

  
47

  
48
    models = {
49
        'db.flavor': {
50
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
51
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
52
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
53
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
54
            'disk_template': ('django.db.models.fields.CharField', [], {'default': "'drbd'", 'max_length': '32'}),
55
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
56
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
57
        },
58
        'db.image': {
59
            'Meta': {'object_name': 'Image'},
60
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
61
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
62
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
63
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
64
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
65
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
66
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
67
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
68
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
69
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
70
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
71
        },
72
        'db.imagemetadata': {
73
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
74
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
75
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
76
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
77
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
78
        },
79
        'db.network': {
80
            'Meta': {'object_name': 'Network'},
81
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
82
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
84
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
85
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
86
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True'}),
87
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
88
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
89
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
90
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
91
        },
92
        'db.networkinterface': {
93
            'Meta': {'object_name': 'NetworkInterface'},
94
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
95
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
96
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
98
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
99
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
100
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
101
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
102
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
103
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
104
        },
105
        'db.networklink': {
106
            'Meta': {'object_name': 'NetworkLink'},
107
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
108
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
109
            'index': ('django.db.models.fields.IntegerField', [], {}),
110
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
111
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
112
        },
113
        'db.synnefouser': {
114
            'Meta': {'object_name': 'SynnefoUser'},
115
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
116
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
117
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
118
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
119
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
120
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
121
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
122
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '30'}),
123
            'tmp_auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
124
            'tmp_auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
125
            'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
126
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
127
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
128
        },
129
        'db.virtualmachine': {
130
            'Meta': {'object_name': 'VirtualMachine'},
131
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
132
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
133
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
134
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
135
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
136
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
137
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 1, 23, 14, 46, 29, 76919)'}),
138
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
139
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
140
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
141
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
142
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
143
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
144
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
145
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
146
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
147
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
148
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
149
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
150
        },
151
        'db.virtualmachinemetadata': {
152
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
153
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
154
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
155
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
156
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
157
        }
158
    }
159

  
160
    complete_apps = ['db']
b/snf-cyclades-app/synnefo/db/migrations/0027_auto__del_legacy_fields.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
        # Deleting model 'FlavorCost'
12
        db.delete_table('db_flavorcost')
13

  
14
        # Deleting model 'Invitations'
15
        db.delete_table('db_invitations')
16

  
17
        # Deleting model 'VirtualMachineGroup'
18
        db.delete_table('db_virtualmachinegroup')
19

  
20
        # Removing M2M table for field machines on 'VirtualMachineGroup'
21
        db.delete_table('db_virtualmachinegroup_machines')
22

  
23
        # Deleting model 'Limit'
24
        db.delete_table('db_limit')
25

  
26
        # Deleting model 'Debit'
27
        db.delete_table('db_debit')
28

  
29
        # Deleting field 'SynnefoUser.credit'
30
        db.delete_column('db_synnefouser', 'credit')
31

  
32
        # Deleting field 'SynnefoUser.max_invitations'
33
        db.delete_column('db_synnefouser', 'max_invitations')
34

  
35

  
36
    def backwards(self, orm):
37
        
38
        # Adding model 'FlavorCost'
39
        db.create_table('db_flavorcost', (
40
            ('cost_active', self.gf('django.db.models.fields.PositiveIntegerField')()),
41
            ('effective_from', self.gf('django.db.models.fields.DateTimeField')()),
42
            ('flavor', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.Flavor'])),
43
            ('cost_inactive', self.gf('django.db.models.fields.PositiveIntegerField')()),
44
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
45
        ))
46
        db.send_create_signal('db', ['FlavorCost'])
47

  
48
        # Adding model 'Invitations'
49
        db.create_table('db_invitations', (
50
            ('source', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['db.SynnefoUser'])),
51
            ('level', self.gf('django.db.models.fields.IntegerField')(null=True)),
52
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
53
            ('target', self.gf('django.db.models.fields.related.ForeignKey')(related_name='target', to=orm['db.SynnefoUser'])),
54
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
55
            ('accepted', self.gf('django.db.models.fields.BooleanField')(default=False)),
56
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
57
        ))
58
        db.send_create_signal('db', ['Invitations'])
59

  
60
        # Adding model 'VirtualMachineGroup'
61
        db.create_table('db_virtualmachinegroup', (
62
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
63
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
64
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
65
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'])),
66
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
67
        ))
68
        db.send_create_signal('db', ['VirtualMachineGroup'])
69

  
70
        # Adding M2M table for field machines on 'VirtualMachineGroup'
71
        db.create_table('db_virtualmachinegroup_machines', (
72
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
73
            ('virtualmachinegroup', models.ForeignKey(orm['db.virtualmachinegroup'], null=False)),
74
            ('virtualmachine', models.ForeignKey(orm['db.virtualmachine'], null=False))
75
        ))
76
        db.create_unique('db_virtualmachinegroup_machines', ['virtualmachinegroup_id', 'virtualmachine_id'])
77

  
78
        # Adding model 'Limit'
79
        db.create_table('db_limit', (
80
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'])),
81
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
82
            ('value', self.gf('django.db.models.fields.IntegerField')()),
83
            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)),
84
        ))
85
        db.send_create_signal('db', ['Limit'])
86

  
87
        # Adding model 'Debit'
88
        db.create_table('db_debit', (
89
            ('description', self.gf('django.db.models.fields.TextField')()),
90
            ('when', self.gf('django.db.models.fields.DateTimeField')()),
91
            ('vm', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.VirtualMachine'])),
92
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'])),
93
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
94
        ))
95
        db.send_create_signal('db', ['Debit'])
96

  
97
        # Adding field 'SynnefoUser.credit'
98
        db.add_column('db_synnefouser', 'credit', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
99

  
100
        # Adding field 'SynnefoUser.max_invitations'
101
        db.add_column('db_synnefouser', 'max_invitations', self.gf('django.db.models.fields.IntegerField')(null=True), keep_default=False)
102

  
103

  
104
    models = {
105
        'db.disk': {
106
            'Meta': {'object_name': 'Disk'},
107
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
108
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
109
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
110
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
111
            'size': ('django.db.models.fields.PositiveIntegerField', [], {}),
112
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
113
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True', 'blank': 'True'})
114
        },
115
        'db.flavor': {
116
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
117
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
118
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
119
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
120
            'disk_template': ('django.db.models.fields.CharField', [], {'default': "'drbd'", 'max_length': '32'}),
121
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
123
        },
124
        'db.image': {
125
            'Meta': {'object_name': 'Image'},
126
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
127
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
128
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
129
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
130
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
131
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
132
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
133
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
134
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
135
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
136
        },
137
        'db.imagemetadata': {
138
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
139
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
140
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
141
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
142
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
143
        },
144
        'db.network': {
145
            'Meta': {'object_name': 'Network'},
146
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
147
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
148
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
149
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
150
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
151
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True'}),
152
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
153
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
154
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
155
        },
156
        'db.networkinterface': {
157
            'Meta': {'object_name': 'NetworkInterface'},
158
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
159
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
160
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
161
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
162
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
163
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
164
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
165
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
166
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
167
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
168
        },
169
        'db.networklink': {
170
            'Meta': {'object_name': 'NetworkLink'},
171
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
172
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
173
            'index': ('django.db.models.fields.IntegerField', [], {}),
174
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
175
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
176
        },
177
        'db.synnefouser': {
178
            'Meta': {'object_name': 'SynnefoUser'},
179
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
180
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
181
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
182
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
183
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
184
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
185
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
186
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '30'}),
187
            'tmp_auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
188
            'tmp_auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
189
            'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
190
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
191
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
192
        },
193
        'db.virtualmachine': {
194
            'Meta': {'object_name': 'VirtualMachine'},
195
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
196
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
197
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
198
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
199
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
200
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
201
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 1, 23, 14, 29, 44, 160884)'}),
202
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
203
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
204
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
205
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
206
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
207
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
208
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
209
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
210
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
211
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
212
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
213
        },
214
        'db.virtualmachinemetadata': {
215
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
216
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
217
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
218
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
219
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
220
        }
221
    }
222

  
223
    complete_apps = ['db']
b/snf-cyclades-app/synnefo/db/migrations/0028_auto__del_disk__add_field_userid.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
        # Deleting model 'Disk'
12
        db.delete_table('db_disk')
13

  
14
        # Adding field 'VirtualMachine.userid'
15
        db.add_column('db_virtualmachine', 'userid', self.gf('django.db.models.fields.CharField')(default='', max_length=100), keep_default=False)
16

  
17
        # Adding field 'Image.userid'
18
        db.add_column('db_image', 'userid', self.gf('django.db.models.fields.CharField')(default='', max_length=100), keep_default=False)
19

  
20
        # Adding field 'Network.userid'
21
        db.add_column('db_network', 'userid', self.gf('django.db.models.fields.CharField')(default='', max_length=100), keep_default=False)
22

  
23

  
24
    def backwards(self, orm):
25
        
26
        # Adding model 'Disk'
27
        db.create_table('db_disk', (
28
            ('vm', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.VirtualMachine'], null=True, blank=True)),
29
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
30
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
31
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
32
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'], null=True, blank=True)),
33
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
34
            ('size', self.gf('django.db.models.fields.PositiveIntegerField')()),
35
        ))
36
        db.send_create_signal('db', ['Disk'])
37

  
38
        # Deleting field 'VirtualMachine.userid'
39
        db.delete_column('db_virtualmachine', 'userid')
40

  
41
        # Deleting field 'Image.userid'
42
        db.delete_column('db_image', 'userid')
43

  
44
        # Deleting field 'Network.userid'
45
        db.delete_column('db_network', 'userid')
46

  
47

  
48
    models = {
49
        'db.flavor': {
50
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
51
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
52
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
53
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
54
            'disk_template': ('django.db.models.fields.CharField', [], {'default': "'drbd'", 'max_length': '32'}),
55
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
56
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
57
        },
58
        'db.image': {
59
            'Meta': {'object_name': 'Image'},
60
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
61
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
62
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
63
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
64
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
65
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
66
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
67
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
68
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
69
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
70
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
71
        },
72
        'db.imagemetadata': {
73
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
74
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
75
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
76
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
77
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
78
        },
79
        'db.network': {
80
            'Meta': {'object_name': 'Network'},
81
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
82
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
84
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
85
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
86
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True'}),
87
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
88
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
89
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
90
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
91
        },
92
        'db.networkinterface': {
93
            'Meta': {'object_name': 'NetworkInterface'},
94
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
95
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
96
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
98
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
99
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
100
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
101
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
102
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
103
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
104
        },
105
        'db.networklink': {
106
            'Meta': {'object_name': 'NetworkLink'},
107
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
108
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
109
            'index': ('django.db.models.fields.IntegerField', [], {}),
110
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
111
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
112
        },
113
        'db.synnefouser': {
114
            'Meta': {'object_name': 'SynnefoUser'},
115
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
116
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
117
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
118
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
119
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
120
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
121
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
122
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '30'}),
123
            'tmp_auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
124
            'tmp_auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
125
            'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
126
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
127
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
128
        },
129
        'db.virtualmachine': {
130
            'Meta': {'object_name': 'VirtualMachine'},
131
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
132
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
133
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
134
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
135
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
136
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
137
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 1, 23, 14, 46, 29, 76919)'}),
138
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
139
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
140
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
141
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
142
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
143
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
144
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
145
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
146
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
147
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
148
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
149
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
150
        },
151
        'db.virtualmachinemetadata': {
152
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
153
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
154
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
155
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
156
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
157
        }
158
    }
159

  
160
    complete_apps = ['db']
/dev/null
1
# encoding: utf-8
2
import datetime
3
from south.db import db
4
from south.v2 import DataMigration
5
from django.db import models
6

  
7
class Migration(DataMigration):
8

  
9
    def forwards(self, orm):
10
        for image in orm.Image.objects.all():
11
            image.userid = str(image.owner.id) if image.owner else ''
12
            image.save()
13
        
14
        for vm in orm.VirtualMachine.objects.all():
15
            vm.userid = str(vm.owner.id) if vm.owner else ''
16
            vm.save()
17
        
18
        for network in orm.Network.objects.all():
19
            network.userid = str(network.owner.id) if network.owner else ''
20
            network.save()
21
    
22
    def backwards(self, orm):
23
        raise RuntimeError("Cannot reverse this migration.")
24

  
25
    models = {
26
        'db.flavor': {
27
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
28
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
29
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
30
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
31
            'disk_template': ('django.db.models.fields.CharField', [], {'default': "'drbd'", 'max_length': '32'}),
32
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
33
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
34
        },
35
        'db.image': {
36
            'Meta': {'object_name': 'Image'},
37
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
38
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
39
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
40
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
41
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
42
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
43
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
44
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
45
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
46
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
47
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
48
        },
49
        'db.imagemetadata': {
50
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
51
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
52
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
53
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
54
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
55
        },
56
        'db.network': {
57
            'Meta': {'object_name': 'Network'},
58
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
59
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
60
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
61
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
62
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
63
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True'}),
64
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
65
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
66
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
67
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
68
        },
69
        'db.networkinterface': {
70
            'Meta': {'object_name': 'NetworkInterface'},
71
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
72
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
73
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
75
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
76
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
77
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
78
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
79
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
80
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
81
        },
82
        'db.networklink': {
83
            'Meta': {'object_name': 'NetworkLink'},
84
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
85
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
86
            'index': ('django.db.models.fields.IntegerField', [], {}),
87
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
88
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
89
        },
90
        'db.synnefouser': {
91
            'Meta': {'object_name': 'SynnefoUser'},
92
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
93
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
94
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
95
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
96
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
98
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
99
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '30'}),
100
            'tmp_auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
101
            'tmp_auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
102
            'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
103
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
104
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
105
        },
106
        'db.virtualmachine': {
107
            'Meta': {'object_name': 'VirtualMachine'},
108
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
109
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
110
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
111
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
112
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
113
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
114
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 1, 23, 14, 49, 47, 844276)'}),
115
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
116
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
117
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
118
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
119
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
120
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
121
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
122
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
123
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
124
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
125
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
126
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
127
        },
128
        'db.virtualmachinemetadata': {
129
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
130
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
132
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
133
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
134
        }
135
    }
136

  
137
    complete_apps = ['db']
/dev/null
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
        # Deleting model 'SynnefoUser'
12
        db.delete_table('db_synnefouser')
13

  
14
        # Deleting field 'VirtualMachine.owner'
15
        db.delete_column('db_virtualmachine', 'owner_id')
16

  
17
        # Deleting field 'Image.owner'
18
        db.delete_column('db_image', 'owner_id')
19

  
20
        # Changing field 'Image.userid'
21
        db.alter_column('db_image', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100, null=True))
22

  
23
        # Deleting field 'Network.owner'
24
        db.delete_column('db_network', 'owner_id')
25

  
26
        # Changing field 'Network.userid'
27
        db.alter_column('db_network', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100, null=True))
28

  
29

  
30
    def backwards(self, orm):
31
        
32
        # Adding model 'SynnefoUser'
33
        db.create_table('db_synnefouser', (
34
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
35
            ('realname', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
36
            ('auth_token', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)),
37
            ('tmp_auth_token_expires', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)),
38
            ('tmp_auth_token', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)),
39
            ('auth_token_expires', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)),
40
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
41
            ('auth_token_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)),
42
            ('name', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
43
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
44
            ('state', self.gf('django.db.models.fields.CharField')(default='ACTIVE', max_length=30)),
45
            ('uniq', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)),
46
            ('type', self.gf('django.db.models.fields.CharField')(max_length=30)),
47
        ))
48
        db.send_create_signal('db', ['SynnefoUser'])
49

  
50
        # User chose to not deal with backwards NULL issues for 'VirtualMachine.owner'
51
        raise RuntimeError("Cannot reverse this migration. 'VirtualMachine.owner' and its values cannot be restored.")
52

  
53
        # Adding field 'Image.owner'
54
        db.add_column('db_image', 'owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'], null=True, blank=True), keep_default=False)
55

  
56
        # Changing field 'Image.userid'
57
        db.alter_column('db_image', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100))
58

  
59
        # Adding field 'Network.owner'
60
        db.add_column('db_network', 'owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'], null=True), keep_default=False)
61

  
62
        # Changing field 'Network.userid'
63
        db.alter_column('db_network', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100))
64

  
65

  
66
    models = {
67
        'db.flavor': {
68
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", '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', [], {'default': "'drbd'", '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.image': {
77
            'Meta': {'object_name': 'Image'},
78
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
79
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
80
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
81
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
82
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
83
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
84
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
85
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
86
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
87
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
88
        },
89
        'db.imagemetadata': {
90
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
91
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
92
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
93
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
94
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
95
        },
96
        'db.network': {
97
            'Meta': {'object_name': 'Network'},
98
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
99
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
100
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
101
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
102
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
103
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
104
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
105
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
106
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
107
        },
108
        'db.networkinterface': {
109
            'Meta': {'object_name': 'NetworkInterface'},
110
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
111
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
112
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
113
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
114
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
115
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
116
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
117
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
118
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
119
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
120
        },
121
        'db.networklink': {
122
            'Meta': {'object_name': 'NetworkLink'},
123
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
124
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125
            'index': ('django.db.models.fields.IntegerField', [], {}),
126
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
127
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
128
        },
129
        'db.virtualmachine': {
130
            'Meta': {'object_name': 'VirtualMachine'},
131
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
132
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
133
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
134
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
135
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
136
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
137
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 1, 23, 15, 32, 51, 475392)'}),
138
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
139
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
140
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
141
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
142
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
143
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
144
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
145
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
146
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
147
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
148
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100'})
149
        },
150
        'db.virtualmachinemetadata': {
151
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
152
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
153
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
154
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
155
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
156
        }
157
    }
158

  
159
    complete_apps = ['db']
b/snf-cyclades-app/synnefo/db/migrations/0029_remove_user.py
1
# encoding: utf-8
2
import datetime
3
from south.db import db
4
from south.v2 import DataMigration
5
from django.db import models
6

  
7
class Migration(DataMigration):
8

  
9
    def forwards(self, orm):
10
        for image in orm.Image.objects.all():
11
            image.userid = str(image.owner.id) if image.owner else ''
12
            image.save()
13
        
14
        for vm in orm.VirtualMachine.objects.all():
15
            vm.userid = str(vm.owner.id) if vm.owner else ''
16
            vm.save()
17
        
18
        for network in orm.Network.objects.all():
19
            network.userid = str(network.owner.id) if network.owner else ''
20
            network.save()
21
    
22
    def backwards(self, orm):
23
        raise RuntimeError("Cannot reverse this migration.")
24

  
25
    models = {
26
        'db.flavor': {
27
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
28
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
29
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
30
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
31
            'disk_template': ('django.db.models.fields.CharField', [], {'default': "'drbd'", 'max_length': '32'}),
32
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
33
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
34
        },
35
        'db.image': {
36
            'Meta': {'object_name': 'Image'},
37
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
38
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
39
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
40
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
41
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
42
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
43
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
44
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
45
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
46
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
47
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
48
        },
49
        'db.imagemetadata': {
50
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
51
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
52
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
53
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
54
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
55
        },
56
        'db.network': {
57
            'Meta': {'object_name': 'Network'},
58
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
59
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
60
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
61
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
62
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
63
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True'}),
64
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
65
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
66
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
67
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
68
        },
69
        'db.networkinterface': {
70
            'Meta': {'object_name': 'NetworkInterface'},
71
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
72
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
73
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
75
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
76
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
77
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
78
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
79
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
80
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
81
        },
82
        'db.networklink': {
83
            'Meta': {'object_name': 'NetworkLink'},
84
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
85
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
86
            'index': ('django.db.models.fields.IntegerField', [], {}),
87
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
88
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
89
        },
90
        'db.synnefouser': {
91
            'Meta': {'object_name': 'SynnefoUser'},
92
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
93
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
94
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
95
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
96
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
98
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
99
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '30'}),
100
            'tmp_auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
101
            'tmp_auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
102
            'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
103
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
104
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
105
        },
106
        'db.virtualmachine': {
107
            'Meta': {'object_name': 'VirtualMachine'},
108
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
109
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
110
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
111
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
112
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
113
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
114
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 1, 23, 14, 49, 47, 844276)'}),
115
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
116
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
117
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
118
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
119
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
120
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
121
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
122
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
123
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
124
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
125
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
126
            'userid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'})
127
        },
128
        'db.virtualmachinemetadata': {
129
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
130
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
132
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
133
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
134
        }
135
    }
136

  
137
    complete_apps = ['db']
/dev/null
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 'ImageMetadata', fields ['meta_key', 'image']
12
        db.delete_unique('db_imagemetadata', ['meta_key', 'image_id'])
13

  
14
        # Deleting model 'ImageMetadata'
15
        db.delete_table('db_imagemetadata')
16

  
17
        # Deleting model 'Image'
18
        db.delete_table('db_image')
19

  
20
        # Deleting field 'VirtualMachine.charged'
21
        db.delete_column('db_virtualmachine', 'charged')
22

  
23

  
24
    def backwards(self, orm):
25
        
26
        # Adding model 'ImageMetadata'
27
        db.create_table('db_imagemetadata', (
28
            ('meta_value', self.gf('django.db.models.fields.CharField')(max_length=500)),
29
            ('image', self.gf('django.db.models.fields.related.ForeignKey')(related_name='metadata', to=orm['db.Image'])),
30
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
31
            ('meta_key', self.gf('django.db.models.fields.CharField')(max_length=50)),
32
        ))
33
        db.send_create_signal('db', ['ImageMetadata'])
34

  
35
        # Adding unique constraint on 'ImageMetadata', fields ['meta_key', 'image']
36
        db.create_unique('db_imagemetadata', ['meta_key', 'image_id'])
37

  
38
        # Adding model 'Image'
39
        db.create_table('db_image', (
40
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
41
            ('format', self.gf('django.db.models.fields.CharField')(default='dump', max_length=30)),
42
            ('sourcevm', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.VirtualMachine'], null=True)),
43
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
44
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
45
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
46
            ('backend_id', self.gf('django.db.models.fields.CharField')(default='debian_base', max_length=50)),
47
            ('userid', self.gf('django.db.models.fields.CharField')(max_length=100, null=True)),
48
            ('state', self.gf('django.db.models.fields.CharField')(max_length=30)),
49
            ('public', self.gf('django.db.models.fields.BooleanField')(default=False)),
50
        ))
51
        db.send_create_signal('db', ['Image'])
52

  
53
        # Adding field 'VirtualMachine.charged'
54
        db.add_column('db_virtualmachine', 'charged', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2012, 1, 23, 15, 32, 51, 475392)), keep_default=False)
55

  
56

  
57
    models = {
58
        'db.flavor': {
59
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
60
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
61
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
62
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
63
            'disk_template': ('django.db.models.fields.CharField', [], {'default': "'drbd'", 'max_length': '32'}),
64
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
66
        },
67
        'db.network': {
68
            'Meta': {'object_name': 'Network'},
69
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
70
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
71
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
72
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
73
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
74
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
75
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
76
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
77
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
78
        },
79
        'db.networkinterface': {
80
            'Meta': {'object_name': 'NetworkInterface'},
81
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
82
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
83
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
84
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
85
            'ipv4': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True'}),
86
            'ipv6': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
87
            'mac': ('django.db.models.fields.CharField', [], {'max_length': '17', 'null': 'True'}),
88
            'machine': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.VirtualMachine']"}),
89
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nics'", 'to': "orm['db.Network']"}),
90
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
91
        },
92
        'db.networklink': {
93
            'Meta': {'object_name': 'NetworkLink'},
94
            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
95
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
96
            'index': ('django.db.models.fields.IntegerField', [], {}),
97
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
98
            'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['db.Network']"})
99
        },
100
        'db.virtualmachine': {
101
            'Meta': {'object_name': 'VirtualMachine'},
102
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
103
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
104
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
105
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
106
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
107
            'buildpercentage': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
108
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
109
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
110
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
111
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
112
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
113
            'imageid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
114
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
115
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
116
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
117
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
118
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100'})
119
        },
120
        'db.virtualmachinemetadata': {
121
            'Meta': {'unique_together': "(('meta_key', 'vm'),)", 'object_name': 'VirtualMachineMetadata'},
122
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
123
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
124
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
125
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.VirtualMachine']"})
126
        }
127
    }
128

  
129
    complete_apps = ['db']
b/snf-cyclades-app/synnefo/db/migrations/0030_auto__del_synnefouser__del_field_virtualmachine_owner__del_field_image.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
        # Deleting model 'SynnefoUser'
12
        db.delete_table('db_synnefouser')
13

  
14
        # Deleting field 'VirtualMachine.owner'
15
        db.delete_column('db_virtualmachine', 'owner_id')
16

  
17
        # Deleting field 'Image.owner'
18
        db.delete_column('db_image', 'owner_id')
19

  
20
        # Changing field 'Image.userid'
21
        db.alter_column('db_image', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100, null=True))
22

  
23
        # Deleting field 'Network.owner'
24
        db.delete_column('db_network', 'owner_id')
25

  
26
        # Changing field 'Network.userid'
27
        db.alter_column('db_network', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100, null=True))
28

  
29

  
30
    def backwards(self, orm):
31
        
32
        # Adding model 'SynnefoUser'
33
        db.create_table('db_synnefouser', (
34
            ('updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
35
            ('realname', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
36
            ('auth_token', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)),
37
            ('tmp_auth_token_expires', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)),
38
            ('tmp_auth_token', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)),
39
            ('auth_token_expires', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)),
40
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
41
            ('auth_token_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)),
42
            ('name', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
43
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
44
            ('state', self.gf('django.db.models.fields.CharField')(default='ACTIVE', max_length=30)),
45
            ('uniq', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)),
46
            ('type', self.gf('django.db.models.fields.CharField')(max_length=30)),
47
        ))
48
        db.send_create_signal('db', ['SynnefoUser'])
49

  
50
        # User chose to not deal with backwards NULL issues for 'VirtualMachine.owner'
51
        raise RuntimeError("Cannot reverse this migration. 'VirtualMachine.owner' and its values cannot be restored.")
52

  
53
        # Adding field 'Image.owner'
54
        db.add_column('db_image', 'owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'], null=True, blank=True), keep_default=False)
55

  
56
        # Changing field 'Image.userid'
57
        db.alter_column('db_image', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100))
58

  
59
        # Adding field 'Network.owner'
60
        db.add_column('db_network', 'owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser'], null=True), keep_default=False)
61

  
62
        # Changing field 'Network.userid'
63
        db.alter_column('db_network', 'userid', self.gf('django.db.models.fields.CharField')(max_length=100))
64

  
65

  
66
    models = {
67
        'db.flavor': {
68
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", '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', [], {'default': "'drbd'", '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.image': {
77
            'Meta': {'object_name': 'Image'},
78
            'backend_id': ('django.db.models.fields.CharField', [], {'default': "'debian_base'", 'max_length': '50'}),
79
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
80
            'format': ('django.db.models.fields.CharField', [], {'default': "'dump'", 'max_length': '30'}),
81
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
82
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
83
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
84
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
85
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
86
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
87
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
88
        },
89
        'db.imagemetadata': {
90
            'Meta': {'unique_together': "(('meta_key', 'image'),)", 'object_name': 'ImageMetadata'},
91
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
92
            'image': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'metadata'", 'to': "orm['db.Image']"}),
93
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
94
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
95
        },
96
        'db.network': {
97
            'Meta': {'object_name': 'Network'},
98
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
99
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
100
            'link': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['db.NetworkLink']"}),
101
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'through': "orm['db.NetworkInterface']", 'symmetrical': 'False'}),
102
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
103
            'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
104
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
105
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
106
            'userid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
107
        },
108
        'db.networkinterface': {
109
            'Meta': {'object_name': 'NetworkInterface'},
110
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
111
            'firewall_profile': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
112
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
113
            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff