add model for compute plans
This commit is contained in:
parent
1347f9c72a
commit
cc5307a723
3 changed files with 115 additions and 4 deletions
70
hub/services/migrations/0022_computeplan.py
Normal file
70
hub/services/migrations/0022_computeplan.py
Normal file
|
@ -0,0 +1,70 @@
|
|||
# Generated by Django 5.2 on 2025-05-20 09:08
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("services", "0021_alter_consultingpartner_options_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="ComputePlan",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=200)),
|
||||
("vcpus", models.FloatField(help_text="Number of available vCPUs")),
|
||||
("ram", models.FloatField(help_text="Amount of RAM available")),
|
||||
(
|
||||
"cpu_mem_ratio",
|
||||
models.FloatField(
|
||||
help_text="vCPU to Memory ratio. How much vCPU per GiB RAM is available?"
|
||||
),
|
||||
),
|
||||
(
|
||||
"price_chf",
|
||||
models.FloatField(help_text="Plan price in CHF excl. VAT"),
|
||||
),
|
||||
(
|
||||
"price_eur",
|
||||
models.FloatField(
|
||||
blank=True, help_text="Plan price in EUR excl. VAT", null=True
|
||||
),
|
||||
),
|
||||
(
|
||||
"price_usd",
|
||||
models.FloatField(
|
||||
blank=True, help_text="Plan price in USD excl. VAT", null=True
|
||||
),
|
||||
),
|
||||
(
|
||||
"active",
|
||||
models.BooleanField(default=True, help_text="Is the plan active?"),
|
||||
),
|
||||
("valid_from", models.DateTimeField(blank=True, null=True)),
|
||||
("valid_to", models.DateTimeField(blank=True, null=True)),
|
||||
(
|
||||
"cloud_provider",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="compute_plans",
|
||||
to="services.cloudprovider",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"ordering": ["price_chf"],
|
||||
},
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue