3 from south
.db
import db
4 from south
.v2
import SchemaMigration
5 from django
.db
import models
7 class Migration(SchemaMigration
):
9 def forwards(self
, orm
):
12 db
.create_table('ganeti_node', (
13 ('cluster_hash', self
.gf('django.db.models.fields.CharField')(max_length
=40)),
14 ('cached', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
15 ('hostname', self
.gf('django.db.models.fields.CharField')(unique
=True, max_length
=128)),
16 ('cluster', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='nodes', to
=orm
['ganeti.Cluster'])),
17 ('disk_total', self
.gf('django.db.models.fields.IntegerField')(default
=-1)),
18 ('role', self
.gf('django.db.models.fields.CharField')(max_length
=1)),
19 ('ignore_cache', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
20 ('ram_total', self
.gf('django.db.models.fields.IntegerField')(default
=-1)),
21 ('mtime', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
22 ('offline', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
23 ('serialized_info', self
.gf('django.db.models.fields.TextField')(default
=None, null
=True)),
24 ('last_job', self
.gf('django.db.models.fields.related.ForeignKey')(to
=orm
['ganeti.Job'], null
=True)),
25 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
27 db
.send_create_signal('ganeti', ['Node'])
29 # Adding model 'VirtualMachineTemplate'
30 db
.create_table('ganeti_virtualmachinetemplate', (
31 ('nic_type', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
32 ('template_name', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
33 ('nic_mode', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
34 ('cluster', self
.gf('django.db.models.fields.related.ForeignKey')(to
=orm
['ganeti.Cluster'], null
=True)),
35 ('disk_template', self
.gf('django.db.models.fields.CharField')(max_length
=16)),
36 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
37 ('pnode', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
38 ('cdrom_image_path', self
.gf('django.db.models.fields.CharField')(max_length
=512, null
=True, blank
=True)),
39 ('name_check', self
.gf('django.db.models.fields.BooleanField')(default
=True, blank
=True)),
40 ('start', self
.gf('django.db.models.fields.BooleanField')(default
=True, blank
=True)),
41 ('memory', self
.gf('django.db.models.fields.IntegerField')(null
=True, blank
=True)),
42 ('kernel_path', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
43 ('boot_order', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
44 ('serial_console', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
45 ('snode', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
46 ('disk_type', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
47 ('iallocator_hostname', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
48 ('disk_size', self
.gf('django.db.models.fields.IntegerField')(null
=True, blank
=True)),
49 ('nic_link', self
.gf('django.db.models.fields.CharField')(max_length
=255, null
=True, blank
=True)),
50 ('root_path', self
.gf('django.db.models.fields.CharField')(default
='/', max_length
=255, null
=True, blank
=True)),
51 ('vcpus', self
.gf('django.db.models.fields.IntegerField')(null
=True, blank
=True)),
52 ('iallocator', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
53 ('os', self
.gf('django.db.models.fields.CharField')(max_length
=255)),
55 db
.send_create_signal('ganeti', ['VirtualMachineTemplate'])
57 # Adding field 'Cluster.last_job'
58 db
.add_column('ganeti_cluster', 'last_job', self
.gf('django.db.models.fields.related.ForeignKey')(blank
=True, related_name
='cluster_last_job', null
=True, to
=orm
['ganeti.Job']), keep_default
=False)
60 # Adding field 'VirtualMachine.secondary_node'
61 db
.add_column('ganeti_virtualmachine', 'secondary_node', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='secondary_vms', null
=True, to
=orm
['ganeti.Node']), keep_default
=False)
63 # Adding field 'VirtualMachine.primary_node'
64 db
.add_column('ganeti_virtualmachine', 'primary_node', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='primary_vms', null
=True, to
=orm
['ganeti.Node']), keep_default
=False)
66 # Adding field 'VirtualMachine.template'
67 db
.add_column('ganeti_virtualmachine', 'template', self
.gf('django.db.models.fields.related.ForeignKey')(to
=orm
['ganeti.VirtualMachineTemplate'], null
=True), keep_default
=False)
70 def backwards(self
, orm
):
72 # Deleting model 'Node'
73 db
.delete_table('ganeti_node')
75 # Deleting model 'VirtualMachineTemplate'
76 db
.delete_table('ganeti_virtualmachinetemplate')
78 # Deleting field 'Cluster.last_job'
79 db
.delete_column('ganeti_cluster', 'last_job_id')
81 # Deleting field 'VirtualMachine.secondary_node'
82 db
.delete_column('ganeti_virtualmachine', 'secondary_node_id')
84 # Deleting field 'VirtualMachine.primary_node'
85 db
.delete_column('ganeti_virtualmachine', 'primary_node_id')
87 # Deleting field 'VirtualMachine.template'
88 db
.delete_column('ganeti_virtualmachine', 'template_id')
93 'Meta': {'object_name': 'Group'},
94 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
95 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
96 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
99 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
100 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
101 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
102 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
103 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
106 'Meta': {'object_name': 'User'},
107 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
108 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
109 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
110 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
111 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
112 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
113 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
114 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
115 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
116 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
117 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
118 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
119 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
121 'contenttypes.contenttype': {
122 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
123 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
124 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
126 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
129 'Meta': {'object_name': 'Cluster'},
130 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
131 'description': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
132 'disk': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
133 'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
134 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
135 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
136 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
137 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cluster_last_job'", 'null': 'True', 'to': "orm['ganeti.Job']"}),
138 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
139 'password': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
140 'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
141 'ram': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
142 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
143 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
144 'username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
145 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
147 'ganeti.clusteruser': {
148 'Meta': {'object_name': 'ClusterUser'},
149 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
150 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
151 'real_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True'})
153 'ganeti.ganetierror': {
154 'Meta': {'object_name': 'GanetiError'},
155 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
156 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']"}),
157 'code': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
158 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
159 'msg': ('django.db.models.fields.TextField', [], {}),
160 'obj_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
161 'obj_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ganeti_errors'", 'to': "orm['contenttypes.ContentType']"}),
162 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
165 'Meta': {'object_name': 'Job'},
166 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
167 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
168 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'jobs'", 'to': "orm['ganeti.Cluster']"}),
169 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
170 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
171 'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
172 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
173 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
174 'job_id': ('django.db.models.fields.IntegerField', [], {}),
175 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
176 'object_id': ('django.db.models.fields.IntegerField', [], {}),
177 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
178 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'})
181 'Meta': {'object_name': 'Node'},
182 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
183 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nodes'", 'to': "orm['ganeti.Cluster']"}),
184 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
185 'disk_total': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
186 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
187 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
188 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
189 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Job']", 'null': 'True'}),
190 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
191 'offline': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
192 'ram_total': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
193 'role': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
194 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
196 'ganeti.organization': {
197 'Meta': {'object_name': 'Organization', '_ormbases': ['ganeti.ClusterUser']},
198 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
199 'group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'organization'", 'unique': 'True', 'to': "orm['auth.Group']"})
202 'Meta': {'object_name': 'Profile', '_ormbases': ['ganeti.ClusterUser']},
203 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
204 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
207 'Meta': {'object_name': 'Quota'},
208 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.Cluster']"}),
209 'disk': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
210 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
211 'ram': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
212 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.ClusterUser']"}),
213 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'})
216 'Meta': {'object_name': 'SSHKey'},
217 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
218 'key': ('django.db.models.fields.TextField', [], {}),
219 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
221 'ganeti.testmodel': {
222 'Meta': {'object_name': 'TestModel'},
223 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
224 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']"}),
225 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
226 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
227 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
228 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
230 'ganeti.virtualmachine': {
231 'Meta': {'unique_together': "(('cluster', 'hostname'),)", 'object_name': 'VirtualMachine'},
232 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
233 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'default': '0', 'related_name': "'virtual_machines'", 'to': "orm['ganeti.Cluster']"}),
234 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
235 'disk_size': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
236 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
237 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
238 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
239 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Job']", 'null': 'True'}),
240 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
241 'operating_system': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
242 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'to': "orm['ganeti.ClusterUser']"}),
243 'pending_delete': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
244 'primary_node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_vms'", 'null': 'True', 'to': "orm['ganeti.Node']"}),
245 'ram': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
246 'secondary_node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'secondary_vms'", 'null': 'True', 'to': "orm['ganeti.Node']"}),
247 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
248 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
249 'template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.VirtualMachineTemplate']", 'null': 'True'}),
250 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '-1'})
252 'ganeti.virtualmachinetemplate': {
253 'Meta': {'object_name': 'VirtualMachineTemplate'},
254 'boot_order': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
255 'cdrom_image_path': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}),
256 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']", 'null': 'True'}),
257 'disk_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
258 'disk_template': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
259 'disk_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
260 'iallocator': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
261 'iallocator_hostname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
262 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
263 'kernel_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
264 'memory': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
265 'name_check': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
266 'nic_link': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
267 'nic_mode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
268 'nic_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
269 'os': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
270 'pnode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
271 'root_path': ('django.db.models.fields.CharField', [], {'default': "'/'", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
272 'serial_console': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
273 'snode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
274 'start': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
275 'template_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
276 'vcpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
280 complete_apps
= ['ganeti']