2020-06-21 12:35:12 +00:00
|
|
|
# Generated by Django 3.0.6 on 2020-06-21 12:34
|
2020-02-26 10:31:17 +00:00
|
|
|
|
|
|
|
from django.conf import settings
|
2020-06-21 12:35:12 +00:00
|
|
|
import django.contrib.postgres.fields.jsonb
|
2020-02-26 10:31:17 +00:00
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
|
|
|
import uuid
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
2020-03-05 10:35:00 +00:00
|
|
|
('uncloud_pay', '0001_initial'),
|
2020-02-26 10:31:17 +00:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2020-06-21 12:35:12 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='VMCluster',
|
|
|
|
fields=[
|
|
|
|
('extra_data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, editable=False, null=True)),
|
|
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
|
|
('name', models.CharField(max_length=128, unique=True)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
2020-02-26 10:31:17 +00:00
|
|
|
migrations.CreateModel(
|
2020-03-03 16:50:52 +00:00
|
|
|
name='VMDiskImageProduct',
|
2020-02-26 10:31:17 +00:00
|
|
|
fields=[
|
2020-06-21 12:35:12 +00:00
|
|
|
('extra_data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, editable=False, null=True)),
|
2020-02-26 10:31:17 +00:00
|
|
|
('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)),
|
2020-06-21 12:35:12 +00:00
|
|
|
('is_public', models.BooleanField(default=False, editable=False)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('size_in_gb', models.FloatField(blank=True, null=True)),
|
|
|
|
('import_url', models.URLField(blank=True, null=True)),
|
2020-03-05 10:35:00 +00:00
|
|
|
('image_source', models.CharField(max_length=128, null=True)),
|
|
|
|
('image_source_type', models.CharField(max_length=128, null=True)),
|
2020-06-21 12:35:12 +00:00
|
|
|
('storage_class', models.CharField(choices=[('HDD', 'HDD'), ('SSD', 'SSD')], default='SSD', max_length=32)),
|
|
|
|
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='PENDING', max_length=32)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('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
|
|
|
],
|
2020-06-21 12:35:12 +00:00
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
2020-02-26 10:31:17 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='VMHost',
|
|
|
|
fields=[
|
2020-06-21 12:35:12 +00:00
|
|
|
('extra_data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, editable=False, null=True)),
|
2020-02-26 10:31:17 +00:00
|
|
|
('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)),
|
2020-06-21 12:35:12 +00:00
|
|
|
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='PENDING', max_length=32)),
|
|
|
|
('vmcluster', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMCluster')),
|
2020-02-26 10:31:17 +00:00
|
|
|
],
|
2020-06-21 12:35:12 +00:00
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
2020-02-26 10:31:17 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='VMProduct',
|
|
|
|
fields=[
|
2020-06-21 12:35:12 +00:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('extra_data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, editable=False, null=True)),
|
|
|
|
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='AWAITING_PAYMENT', max_length=32)),
|
|
|
|
('name', models.CharField(blank=True, max_length=32, null=True)),
|
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-06-21 12:35:12 +00:00
|
|
|
('vmcluster', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMCluster')),
|
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='VMSnapshotProduct',
|
2020-02-26 10:31:17 +00:00
|
|
|
fields=[
|
2020-06-21 12:35:12 +00:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('extra_data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, editable=False, null=True)),
|
|
|
|
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='AWAITING_PAYMENT', max_length=32)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('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)),
|
2020-06-21 12:35:12 +00:00
|
|
|
('vm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='snapshots', 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')),
|
2020-03-05 10:35:00 +00:00
|
|
|
('mac_address', models.BigIntegerField()),
|
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=[
|
2020-06-21 12:35:12 +00:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('extra_data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, editable=False, null=True)),
|
|
|
|
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='AWAITING_PAYMENT', max_length=32)),
|
2020-03-03 16:50:52 +00:00
|
|
|
('size_in_gb', models.FloatField(blank=True)),
|
|
|
|
('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMDiskImageProduct')),
|
2020-06-21 12:35:12 +00:00
|
|
|
('order', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.Order')),
|
2020-03-03 16:50:52 +00:00
|
|
|
('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-06-21 12:35:12 +00:00
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
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')),
|
|
|
|
('primary_disk', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_vm.VMDiskProduct')),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
bases=('uncloud_vm.vmproduct',),
|
2020-02-26 10:31:17 +00:00
|
|
|
),
|
|
|
|
]
|