uncloud-mravi/uncloud/uncloud_vm/migrations/0001_initial.py
Ahmed Bilal 0c7ca1147a fix migrations the ugly way
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-02-26 11:31:17 +01:00

75 lines
3.3 KiB
Python

# Generated by Django 3.0.3 on 2020-02-25 19:50
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='VMDiskProduct',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('size_in_gb', models.FloatField()),
('storage_class', models.CharField(choices=[('hdd', 'HDD'), ('ssd', 'SSD')], default='ssd', max_length=32)),
],
),
migrations.CreateModel(
name='VMHost',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('hostname', models.CharField(max_length=253)),
('physical_cores', models.IntegerField()),
('usable_cores', models.IntegerField()),
('usable_ram_in_gb', models.FloatField()),
('status', models.CharField(choices=[('pending', 'Pending'), ('active', 'Active'), ('unusable', 'Unusable')], default='pending', max_length=32)),
],
),
migrations.CreateModel(
name='VMProduct',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('cores', models.IntegerField()),
('ram_in_gb', models.FloatField()),
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('vmhost', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMHost')),
],
),
migrations.CreateModel(
name='OperatingSystemDisk',
fields=[
('vmdiskproduct_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='uncloud_vm.VMDiskProduct')),
('os_name', models.CharField(max_length=128)),
],
bases=('uncloud_vm.vmdiskproduct',),
),
migrations.CreateModel(
name='VMWithOSProduct',
fields=[
('vmproduct_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='uncloud_vm.VMProduct')),
],
bases=('uncloud_vm.vmproduct',),
),
migrations.CreateModel(
name='VMNetworkCard',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('mac_address', models.IntegerField()),
('vm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMProduct')),
],
),
migrations.AddField(
model_name='vmdiskproduct',
name='vm',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMProduct'),
),
]