Validate entire job, not just op
[ganeti_webmgr.git] / deprecated / ganeti / migrations / 0002_version_0_5.py
blobfcbe6d7a8301ac29e5414af17e4cd9a88b9b1da1
1 # Copyright (C) 2010 Oregon State University et al.
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
16 # USA.
18 # encoding: utf-8
19 import datetime
20 from south.db import db
21 from south.v2 import SchemaMigration
22 from django.db import models
24 class Migration(SchemaMigration):
26 def forwards(self, orm):
28 # Adding model 'GanetiError'
29 db.create_table('ganeti_ganetierror', (
30 ('obj_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='ganeti_errors', to=orm['contenttypes.ContentType'])),
31 ('code', self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True, blank=True)),
32 ('obj_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
33 ('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
34 ('cluster', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ganeti.Cluster'])),
35 ('msg', self.gf('django.db.models.fields.TextField')()),
36 ('cleared', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)),
37 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
39 db.send_create_signal('ganeti', ['GanetiError'])
41 # Adding field 'VirtualMachine.pending_delete'
42 db.add_column('ganeti_virtualmachine', 'pending_delete', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True), keep_default=False)
44 # Adding unique constraint on 'VirtualMachine', fields ['cluster', 'hostname']
45 db.create_unique('ganeti_virtualmachine', ['cluster_id', 'hostname'])
47 # Adding field 'TestModel.cluster'
48 db.add_column('ganeti_testmodel', 'cluster', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['ganeti.Cluster']), keep_default=False)
50 # Adding field 'Job.cleared'
51 db.add_column('ganeti_job', 'cleared', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True), keep_default=False)
54 def backwards(self, orm):
56 # Deleting model 'GanetiError'
57 db.delete_table('ganeti_ganetierror')
59 # Deleting field 'VirtualMachine.pending_delete'
60 db.delete_column('ganeti_virtualmachine', 'pending_delete')
62 # Removing unique constraint on 'VirtualMachine', fields ['cluster', 'hostname']
63 db.delete_unique('ganeti_virtualmachine', ['cluster_id', 'hostname'])
65 # Deleting field 'TestModel.cluster'
66 db.delete_column('ganeti_testmodel', 'cluster_id')
68 # Deleting field 'Job.cleared'
69 db.delete_column('ganeti_job', 'cleared')
72 models = {
73 'auth.group': {
74 'Meta': {'object_name': 'Group'},
75 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
76 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
77 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
79 'auth.permission': {
80 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
81 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
82 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
83 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
84 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
86 'auth.user': {
87 'Meta': {'object_name': 'User'},
88 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
89 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
90 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
91 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
92 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
93 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
94 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
95 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
96 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
97 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
98 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
99 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
100 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
102 'contenttypes.contenttype': {
103 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
104 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
105 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
106 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
107 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
109 'ganeti.cluster': {
110 'Meta': {'object_name': 'Cluster'},
111 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
112 'description': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
113 'disk': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
114 'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
115 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
116 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
117 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
118 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
119 'password': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
120 'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
121 'ram': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
122 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
123 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
124 'username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
125 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
127 'ganeti.clusteruser': {
128 'Meta': {'object_name': 'ClusterUser'},
129 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
130 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
131 'real_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True'})
133 'ganeti.ganetierror': {
134 'Meta': {'object_name': 'GanetiError'},
135 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
136 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']"}),
137 'code': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
138 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
139 'msg': ('django.db.models.fields.TextField', [], {}),
140 'obj_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
141 'obj_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ganeti_errors'", 'to': "orm['contenttypes.ContentType']"}),
142 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
144 'ganeti.job': {
145 'Meta': {'object_name': 'Job'},
146 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
147 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
148 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'jobs'", 'to': "orm['ganeti.Cluster']"}),
149 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
150 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
151 'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
152 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
153 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
154 'job_id': ('django.db.models.fields.IntegerField', [], {}),
155 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
156 'object_id': ('django.db.models.fields.IntegerField', [], {}),
157 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
158 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'})
160 'ganeti.organization': {
161 'Meta': {'object_name': 'Organization', '_ormbases': ['ganeti.ClusterUser']},
162 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
163 'group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'organization'", 'unique': 'True', 'to': "orm['auth.Group']"})
165 'ganeti.profile': {
166 'Meta': {'object_name': 'Profile', '_ormbases': ['ganeti.ClusterUser']},
167 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
168 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
170 'ganeti.quota': {
171 'Meta': {'object_name': 'Quota'},
172 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.Cluster']"}),
173 'disk': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
174 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
175 'ram': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
176 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.ClusterUser']"}),
177 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'})
179 'ganeti.sshkey': {
180 'Meta': {'object_name': 'SSHKey'},
181 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
182 'key': ('django.db.models.fields.TextField', [], {}),
183 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
185 'ganeti.testmodel': {
186 'Meta': {'object_name': 'TestModel'},
187 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
188 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']"}),
189 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
190 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
191 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
192 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
194 'ganeti.virtualmachine': {
195 'Meta': {'unique_together': "(('cluster', 'hostname'),)", 'object_name': 'VirtualMachine'},
196 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
197 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'default': '0', 'related_name': "'virtual_machines'", 'to': "orm['ganeti.Cluster']"}),
198 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
199 'disk_size': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
200 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
201 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
202 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
203 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Job']", 'null': 'True'}),
204 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
205 'operating_system': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
206 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'to': "orm['ganeti.ClusterUser']"}),
207 'pending_delete': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
208 'ram': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
209 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
210 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
211 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '-1'})
215 complete_apps = ['ganeti']