mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
Added migration
This commit is contained in:
parent
5ccc813336
commit
1f68e8c5ed
7 changed files with 71 additions and 40 deletions
29
create/migrations/0002_auto_20150325_0921.py
Normal file
29
create/migrations/0002_auto_20150325_0921.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
def add_favors(apps, schema_editor):
|
||||
Flavor = apps.get_model("create", "Flavor")
|
||||
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()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('create', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_favors),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue