aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/migrations/0001_initial.py
blob: abe6f5e72dc132451424714950b103c366fc6bdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
##############################################################################
# Copyright (c) 2018 Parker Berberian, Sawyer Bergeron, and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
# Generated by Django 2.1 on 2018-09-14 14:48

import api.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('booking', '__first__'),
        ('resource_inventory', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='AccessRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HostHardwareRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
                ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resource_inventory.Host')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HostNetworkRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
                ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resource_inventory.Host')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('delta', models.TextField()),
                ('complete', models.BooleanField(default=False)),
                ('booking', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='booking.Booking')),
            ],
        ),
        migrations.CreateModel(
            name='OpnfvApiConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('installer', models.CharField(max_length=100)),
                ('scenario', models.CharField(max_length=100)),
                ('delta', models.TextField()),
                ('roles', models.ManyToManyField(to='resource_inventory.Host')),
            ],
        ),
        migrations.CreateModel(
            name='SoftwareRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
                ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TaskConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='AccessConfig',
            fields=[
                ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
                ('access_type', models.CharField(max_length=50)),
                ('revoke', models.BooleanField(default=False)),
                ('context', models.TextField(default='')),
                ('delta', models.TextField()),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            bases=('api.taskconfig',),
        ),
        migrations.CreateModel(
            name='HardwareConfig',
            fields=[
                ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
                ('image', models.CharField(default='defimage', max_length=100)),
                ('power', models.CharField(default='off', max_length=100)),
                ('hostname', models.CharField(default='hostname', max_length=100)),
                ('ipmi_create', models.BooleanField(default=False)),
                ('delta', models.TextField()),
            ],
            bases=('api.taskconfig',),
        ),
        migrations.CreateModel(
            name='NetworkConfig',
            fields=[
                ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
                ('delta', models.TextField()),
                ('interfaces', models.ManyToManyField(to='resource_inventory.Interface')),
            ],
            bases=('api.taskconfig',),
        ),
        migrations.CreateModel(
            name='SoftwareConfig',
            fields=[
                ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
                ('opnfv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.OpnfvApiConfig')),
            ],
            bases=('api.taskconfig',),
        ),
        migrations.AddField(
            model_name='hostnetworkrelation',
            name='job',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
        ),
        migrations.AddField(
            model_name='hosthardwarerelation',
            name='job',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
        ),
        migrations.AddField(
            model_name='accessrelation',
            name='job',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
        ),
        migrations.AddField(
            model_name='softwarerelation',
            name='config',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.SoftwareConfig'),
        ),
        migrations.AddField(
            model_name='hostnetworkrelation',
            name='config',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.NetworkConfig'),
        ),
        migrations.AddField(
            model_name='hosthardwarerelation',
            name='config',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.HardwareConfig'),
        ),
        migrations.AddField(
            model_name='accessrelation',
            name='config',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.AccessConfig'),
        ),
    ]