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,
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 'TestModel'
29 db
.create_table('ganeti_testmodel', (
30 ('cached', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
31 ('ignore_cache', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
32 ('serialized_info', self
.gf('django.db.models.fields.TextField')(default
=None, null
=True)),
33 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
34 ('mtime', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
36 db
.send_create_signal('ganeti', ['TestModel'])
39 db
.create_table('ganeti_job', (
40 ('status', self
.gf('django.db.models.fields.CharField')(max_length
=10)),
41 ('job_id', self
.gf('django.db.models.fields.IntegerField')()),
42 ('cluster_hash', self
.gf('django.db.models.fields.CharField')(max_length
=40)),
43 ('cached', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
44 ('object_id', self
.gf('django.db.models.fields.IntegerField')()),
45 ('cluster', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='jobs', to
=orm
['ganeti.Cluster'])),
46 ('finished', self
.gf('django.db.models.fields.DateTimeField')(null
=True)),
47 ('ignore_cache', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
48 ('content_type', self
.gf('django.db.models.fields.related.ForeignKey')(to
=orm
['contenttypes.ContentType'])),
49 ('mtime', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
50 ('serialized_info', self
.gf('django.db.models.fields.TextField')(default
=None, null
=True)),
51 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
53 db
.send_create_signal('ganeti', ['Job'])
55 # Adding model 'VirtualMachine'
56 db
.create_table('ganeti_virtualmachine', (
57 ('status', self
.gf('django.db.models.fields.CharField')(max_length
=10)),
58 ('ram', self
.gf('django.db.models.fields.IntegerField')(default
=-1)),
59 ('disk_size', self
.gf('django.db.models.fields.IntegerField')(default
=-1)),
60 ('cluster_hash', self
.gf('django.db.models.fields.CharField')(max_length
=40)),
61 ('cached', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
62 ('hostname', self
.gf('django.db.models.fields.CharField')(max_length
=128)),
63 ('cluster', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='virtual_machines', to
=orm
['ganeti.Cluster'])),
64 ('operating_system', self
.gf('django.db.models.fields.CharField')(max_length
=128)),
65 ('last_job', self
.gf('django.db.models.fields.related.ForeignKey')(to
=orm
['ganeti.Job'], null
=True)),
66 ('ignore_cache', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
67 ('mtime', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
68 ('owner', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='virtual_machines', null
=True, to
=orm
['ganeti.ClusterUser'])),
69 ('virtual_cpus', self
.gf('django.db.models.fields.IntegerField')(default
=-1)),
70 ('serialized_info', self
.gf('django.db.models.fields.TextField')(default
=None, null
=True)),
71 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
73 db
.send_create_signal('ganeti', ['VirtualMachine'])
75 # Adding model 'Cluster'
76 db
.create_table('ganeti_cluster', (
77 ('username', self
.gf('django.db.models.fields.CharField')(max_length
=128, null
=True, blank
=True)),
78 ('disk', self
.gf('django.db.models.fields.IntegerField')(null
=True, blank
=True)),
79 ('hash', self
.gf('django.db.models.fields.CharField')(max_length
=40)),
80 ('description', self
.gf('django.db.models.fields.CharField')(max_length
=128, null
=True, blank
=True)),
81 ('cached', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
82 ('hostname', self
.gf('django.db.models.fields.CharField')(unique
=True, max_length
=128)),
83 ('ram', self
.gf('django.db.models.fields.IntegerField')(null
=True, blank
=True)),
84 ('slug', self
.gf('django.db.models.fields.SlugField')(unique
=True, max_length
=50, db_index
=True)),
85 ('port', self
.gf('django.db.models.fields.PositiveIntegerField')(default
=5080)),
86 ('ignore_cache', self
.gf('django.db.models.fields.BooleanField')(default
=False, blank
=True)),
87 ('mtime', self
.gf('ganeti_web.fields.PreciseDateTimeField')(null
=True, max_digits
=18, decimal_places
=6)),
88 ('virtual_cpus', self
.gf('django.db.models.fields.IntegerField')(null
=True, blank
=True)),
89 ('serialized_info', self
.gf('django.db.models.fields.TextField')(default
=None, null
=True)),
90 ('password', self
.gf('django.db.models.fields.CharField')(max_length
=128, null
=True, blank
=True)),
91 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
93 db
.send_create_signal('ganeti', ['Cluster'])
95 # Adding model 'ClusterUser'
96 db
.create_table('ganeti_clusteruser', (
97 ('real_type', self
.gf('django.db.models.fields.related.ForeignKey')(to
=orm
['contenttypes.ContentType'], null
=True)),
98 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
99 ('name', self
.gf('django.db.models.fields.CharField')(max_length
=128)),
101 db
.send_create_signal('ganeti', ['ClusterUser'])
103 # Adding model 'Profile'
104 db
.create_table('ganeti_profile', (
105 ('user', self
.gf('django.db.models.fields.related.OneToOneField')(to
=orm
['auth.User'], unique
=True)),
106 ('clusteruser_ptr', self
.gf('django.db.models.fields.related.OneToOneField')(to
=orm
['ganeti.ClusterUser'], unique
=True, primary_key
=True)),
108 db
.send_create_signal('ganeti', ['Profile'])
110 # Adding model 'Organization'
111 db
.create_table('ganeti_organization', (
112 ('group', self
.gf('django.db.models.fields.related.OneToOneField')(related_name
='organization', unique
=True, to
=orm
['auth.Group'])),
113 ('clusteruser_ptr', self
.gf('django.db.models.fields.related.OneToOneField')(to
=orm
['ganeti.ClusterUser'], unique
=True, primary_key
=True)),
115 db
.send_create_signal('ganeti', ['Organization'])
117 # Adding model 'Quota'
118 db
.create_table('ganeti_quota', (
119 ('ram', self
.gf('django.db.models.fields.IntegerField')(default
=0, null
=True)),
120 ('cluster', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='quotas', to
=orm
['ganeti.Cluster'])),
121 ('user', self
.gf('django.db.models.fields.related.ForeignKey')(related_name
='quotas', to
=orm
['ganeti.ClusterUser'])),
122 ('virtual_cpus', self
.gf('django.db.models.fields.IntegerField')(default
=0, null
=True)),
123 ('disk', self
.gf('django.db.models.fields.IntegerField')(default
=0, null
=True)),
124 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
126 db
.send_create_signal('ganeti', ['Quota'])
128 # Adding model 'SSHKey'
129 db
.create_table('ganeti_sshkey', (
130 ('id', self
.gf('django.db.models.fields.AutoField')(primary_key
=True)),
131 ('key', self
.gf('django.db.models.fields.TextField')()),
132 ('user', self
.gf('django.db.models.fields.related.ForeignKey')(to
=orm
['auth.User'])),
134 db
.send_create_signal('ganeti', ['SSHKey'])
137 def backwards(self
, orm
):
139 # Deleting model 'TestModel'
140 db
.delete_table('ganeti_testmodel')
142 # Deleting model 'Job'
143 db
.delete_table('ganeti_job')
145 # Deleting model 'VirtualMachine'
146 db
.delete_table('ganeti_virtualmachine')
148 # Deleting model 'Cluster'
149 db
.delete_table('ganeti_cluster')
151 # Deleting model 'ClusterUser'
152 db
.delete_table('ganeti_clusteruser')
154 # Deleting model 'Profile'
155 db
.delete_table('ganeti_profile')
157 # Deleting model 'Organization'
158 db
.delete_table('ganeti_organization')
160 # Deleting model 'Quota'
161 db
.delete_table('ganeti_quota')
163 # Deleting model 'SSHKey'
164 db
.delete_table('ganeti_sshkey')
169 'Meta': {'object_name': 'Group'},
170 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
171 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
172 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
175 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
176 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
177 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
178 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
179 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
182 'Meta': {'object_name': 'User'},
183 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
184 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
185 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
186 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
187 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
188 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
189 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
190 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
191 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
192 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
193 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
194 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
195 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
197 'contenttypes.contenttype': {
198 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
199 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
200 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
201 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
202 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
205 'Meta': {'object_name': 'Cluster'},
206 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
207 'description': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
208 'disk': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
209 'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
210 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
211 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
212 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
213 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
214 'password': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
215 'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
216 'ram': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
217 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
218 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
219 'username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
220 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
222 'ganeti.clusteruser': {
223 'Meta': {'object_name': 'ClusterUser'},
224 'clusters': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'users'", 'symmetrical': 'False', 'through': "orm['ganeti.Quota']", 'to': "orm['ganeti.Cluster']"}),
225 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
226 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
227 'real_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True'})
230 'Meta': {'object_name': 'Job'},
231 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
232 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'jobs'", 'to': "orm['ganeti.Cluster']"}),
233 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
234 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
235 'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
236 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
237 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
238 'job_id': ('django.db.models.fields.IntegerField', [], {}),
239 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
240 'object_id': ('django.db.models.fields.IntegerField', [], {}),
241 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
242 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'})
244 'ganeti.organization': {
245 'Meta': {'object_name': 'Organization', '_ormbases': ['ganeti.ClusterUser']},
246 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
247 'group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'organization'", 'unique': 'True', 'to': "orm['auth.Group']"})
250 'Meta': {'object_name': 'Profile', '_ormbases': ['ganeti.ClusterUser']},
251 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
252 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
255 'Meta': {'object_name': 'Quota'},
256 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.Cluster']"}),
257 'disk': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
258 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
259 'ram': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
260 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.ClusterUser']"}),
261 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'})
264 'Meta': {'object_name': 'SSHKey'},
265 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
266 'key': ('django.db.models.fields.TextField', [], {}),
267 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
269 'ganeti.testmodel': {
270 'Meta': {'object_name': 'TestModel'},
271 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
272 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
273 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
274 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
275 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
277 'ganeti.virtualmachine': {
278 'Meta': {'object_name': 'VirtualMachine'},
279 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
280 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'to': "orm['ganeti.Cluster']"}),
281 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
282 'disk_size': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
283 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
284 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
285 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
286 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Job']", 'null': 'True'}),
287 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
288 'operating_system': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
289 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'to': "orm['ganeti.ClusterUser']"}),
290 'ram': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
291 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
292 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
293 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '-1'})
297 complete_apps
= ['ganeti']