0001_initial.py 5.2 KB
Newer Older
Kálmán Viktor committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
import model_utils.fields
import django.core.validators


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15
        ('contenttypes', '0001_initial'),
Kálmán Viktor committed
16 17 18 19 20
        ('vm', '0002_interface_model'),
    ]

    operations = [
        migrations.CreateModel(
21
            name='ExtendLeaseAction',
Kálmán Viktor committed
22 23
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
24
                ('instance', models.ForeignKey(to='vm.Instance')),
Kálmán Viktor committed
25 26 27 28 29 30 31
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
32
            name='LeaseType',
Kálmán Viktor committed
33 34
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
35 36
                ('name', models.CharField(max_length=25)),
                ('lease', models.ForeignKey(to='vm.Lease')),
Kálmán Viktor committed
37 38
            ],
            options={
39
                'abstract': False,
Kálmán Viktor committed
40 41 42 43
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
44
            name='Request',
Kálmán Viktor committed
45 46
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
47 48
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
49
                ('status', models.CharField(default=b'PENDING', max_length=10, choices=[(b'PENDING', 'pending'), (b'ACCEPTED', 'accepted'), (b'DECLINED', 'declined')])),
50
                ('type', models.CharField(max_length=10, choices=[(b'resource', 'resource request'), (b'lease', 'lease request'), (b'template', 'template access')])),
51 52
                ('message', models.TextField(verbose_name='Message')),
                ('reason', models.TextField(verbose_name='Reason')),
53
                ('object_id', models.IntegerField()),
54
                ('closed_by', models.ForeignKey(related_name='closed_by', to=settings.AUTH_USER_MODEL, null=True)),
55
                ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
56
                ('user', models.ForeignKey(related_name='user', to=settings.AUTH_USER_MODEL)),
Kálmán Viktor committed
57 58
            ],
            options={
59
                'abstract': False,
Kálmán Viktor committed
60 61 62 63 64 65
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ResourceChangeAction',
            fields=[
66
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
Kálmán Viktor committed
67 68 69 70 71 72
                ('num_cores', models.IntegerField(help_text='Number of virtual CPU cores available to the virtual machine.', verbose_name='number of cores', validators=[django.core.validators.MinValueValidator(0)])),
                ('ram_size', models.IntegerField(help_text='Mebibytes of memory.', verbose_name='RAM size', validators=[django.core.validators.MinValueValidator(0)])),
                ('priority', models.IntegerField(help_text='CPU priority.', verbose_name='priority', validators=[django.core.validators.MinValueValidator(0)])),
                ('instance', models.ForeignKey(to='vm.Instance')),
            ],
            options={
73
                'abstract': False,
Kálmán Viktor committed
74
            },
75
            bases=(models.Model,),
Kálmán Viktor committed
76 77 78 79
        ),
        migrations.CreateModel(
            name='TemplateAccessAction',
            fields=[
80
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
Kálmán Viktor committed
81 82 83
                ('level', models.CharField(default=b'user', max_length=10, choices=[(b'user', 'user'), (b'operator', 'operator')])),
            ],
            options={
84
                'abstract': False,
Kálmán Viktor committed
85
            },
86
            bases=(models.Model,),
Kálmán Viktor committed
87 88 89 90
        ),
        migrations.CreateModel(
            name='TemplateAccessType',
            fields=[
91 92
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=25)),
Kálmán Viktor committed
93 94 95
                ('templates', models.ManyToManyField(to='vm.InstanceTemplate')),
            ],
            options={
96
                'abstract': False,
Kálmán Viktor committed
97
            },
98
            bases=(models.Model,),
Kálmán Viktor committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
        ),
        migrations.AddField(
            model_name='templateaccessaction',
            name='template_type',
            field=models.ForeignKey(to='request.TemplateAccessType'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='templateaccessaction',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='extendleaseaction',
            name='lease_type',
            field=models.ForeignKey(to='request.LeaseType'),
            preserve_default=True,
        ),
    ]