2020-03-16 13:59:45 +00:00
|
|
|
# Generated by Django 2.2.10 on 2020-01-28 07:01
|
2015-03-25 09:36:37 +00:00
|
|
|
|
2015-03-27 15:12:15 +00:00
|
|
|
from django.db import migrations
|
|
|
|
|
2015-03-25 09:36:37 +00:00
|
|
|
|
2020-07-13 09:33:09 +00:00
|
|
|
def add_flavors(apps, schema_editor):
|
|
|
|
Flavor = apps.get_model("instances", "Flavor")
|
2015-03-25 09:36:37 +00:00
|
|
|
add_flavor = Flavor(label="micro", vcpu="1", memory="512", disk="20")
|
|
|
|
add_flavor.save()
|
|
|
|
add_flavor = Flavor(label="mini", vcpu="2", memory="1024", disk="30")
|
|
|
|
add_flavor.save()
|
|
|
|
add_flavor = Flavor(label="small", vcpu="2", memory="2048", disk="40")
|
|
|
|
add_flavor.save()
|
|
|
|
add_flavor = Flavor(label="medium", vcpu="2", memory="4096", disk="60")
|
|
|
|
add_flavor.save()
|
|
|
|
add_flavor = Flavor(label="large", vcpu="4", memory="8192", disk="80")
|
|
|
|
add_flavor.save()
|
|
|
|
add_flavor = Flavor(label="xlarge", vcpu="8", memory="16384", disk="160")
|
|
|
|
add_flavor.save()
|
|
|
|
|
2015-03-27 15:12:15 +00:00
|
|
|
|
2020-07-13 09:33:09 +00:00
|
|
|
def del_flavors(apps, schema_editor):
|
|
|
|
Flavor = apps.get_model("instances", "Flavor")
|
|
|
|
Flavor.objects.all().delete()
|
|
|
|
|
|
|
|
|
2015-03-25 09:36:37 +00:00
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2020-07-13 09:33:09 +00:00
|
|
|
('instances', '0005_flavor'),
|
2015-03-25 09:36:37 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2020-07-13 09:33:09 +00:00
|
|
|
migrations.RunPython(add_flavors, del_flavors),
|
2020-03-16 13:59:45 +00:00
|
|
|
]
|