2020-03-03 16:50:52 +00:00
|
|
|
# Generated by Django 3.0.3 on 2020-03-03 16:50
|
2020-02-26 10:31:17 +00:00
|
|
|
|
|
|
|
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 = [
|
2020-03-03 16:50:52 +00:00
|
|
|
('uncloud_pay', '__first__'),
|
2020-02-26 10:31:17 +00:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2020-03-03 16:50:52 +00:00
|
|
|
name='VMDiskImageProduct',
|
2020-02-26 10:31:17 +00:00
|
|
|
fields=[
|
|
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('name', models.CharField(max_length=256)),
|
|
|
|
('is_os_image', models.BooleanField(default=False)),
|
|
|
|
('is_public', models.BooleanField(default=False)),
|
|
|
|
('size_in_gb', models.FloatField(blank=True, null=True)),
|
|
|
|
('import_url', models.URLField(blank=True, null=True)),
|
2020-02-26 10:31:17 +00:00
|
|
|
('storage_class', models.CharField(choices=[('hdd', 'HDD'), ('ssd', 'SSD')], default='ssd', max_length=32)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('status', models.CharField(choices=[('pending', 'Pending'), ('creating', 'Creating'), ('active', 'Active'), ('disabled', 'Disabled'), ('unusable', 'Unusable'), ('deleted', 'Deleted')], default='pending', max_length=32)),
|
|
|
|
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
2020-02-26 10:31:17 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='VMHost',
|
|
|
|
fields=[
|
|
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('hostname', models.CharField(max_length=253, unique=True)),
|
|
|
|
('physical_cores', models.IntegerField(default=0)),
|
|
|
|
('usable_cores', models.IntegerField(default=0)),
|
|
|
|
('usable_ram_in_gb', models.FloatField(default=0)),
|
|
|
|
('status', models.CharField(choices=[('pending', 'Pending'), ('creating', 'Creating'), ('active', 'Active'), ('disabled', 'Disabled'), ('unusable', 'Unusable'), ('deleted', 'Deleted')], default='pending', max_length=32)),
|
2020-02-26 10:31:17 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='VMProduct',
|
|
|
|
fields=[
|
|
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('status', models.CharField(choices=[('pending', 'Pending'), ('being_created', 'Being created'), ('active', 'Active'), ('deleted', 'Deleted')], default='pending', max_length=256)),
|
|
|
|
('name', models.CharField(max_length=32)),
|
2020-02-26 10:31:17 +00:00
|
|
|
('cores', models.IntegerField()),
|
|
|
|
('ram_in_gb', models.FloatField()),
|
2020-03-03 16:50:52 +00:00
|
|
|
('order', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.Order')),
|
2020-02-26 10:31:17 +00:00
|
|
|
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('vmhost', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMHost')),
|
2020-02-26 10:31:17 +00:00
|
|
|
],
|
2020-03-03 16:50:52 +00:00
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
2020-02-26 10:31:17 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2020-03-03 16:50:52 +00:00
|
|
|
name='VMWithOSProduct',
|
2020-02-26 10:31:17 +00:00
|
|
|
fields=[
|
2020-03-03 16:50:52 +00:00
|
|
|
('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')),
|
2020-02-26 10:31:17 +00:00
|
|
|
],
|
2020-03-03 16:50:52 +00:00
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
bases=('uncloud_vm.vmproduct',),
|
2020-02-26 10:31:17 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2020-03-03 16:50:52 +00:00
|
|
|
name='VMSnapshotProduct',
|
2020-02-26 10:31:17 +00:00
|
|
|
fields=[
|
2020-03-03 16:50:52 +00:00
|
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
|
|
('status', models.CharField(choices=[('pending', 'Pending'), ('being_created', 'Being created'), ('active', 'Active'), ('deleted', 'Deleted')], default='pending', max_length=256)),
|
|
|
|
('gb_ssd', models.FloatField(editable=False)),
|
|
|
|
('gb_hdd', models.FloatField(editable=False)),
|
|
|
|
('order', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.Order')),
|
|
|
|
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
|
|
('vm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMProduct')),
|
2020-02-26 10:31:17 +00:00
|
|
|
],
|
2020-03-03 16:50:52 +00:00
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
2020-02-26 10:31:17 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='VMNetworkCard',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('mac_address', models.IntegerField()),
|
2020-03-03 16:50:52 +00:00
|
|
|
('ip_address', models.GenericIPAddressField(blank=True, null=True)),
|
2020-02-26 10:31:17 +00:00
|
|
|
('vm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMProduct')),
|
|
|
|
],
|
|
|
|
),
|
2020-03-03 16:50:52 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='VMDiskProduct',
|
|
|
|
fields=[
|
|
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
|
|
('size_in_gb', models.FloatField(blank=True)),
|
|
|
|
('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMDiskImageProduct')),
|
|
|
|
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
|
|
('vm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMProduct')),
|
|
|
|
],
|
2020-02-26 10:31:17 +00:00
|
|
|
),
|
|
|
|
]
|