87 lines
2.8 KiB
Python
87 lines
2.8 KiB
Python
# Generated by Django 5.2 on 2025-05-22 14:13
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("services", "0023_alter_computeplan_options_and_more"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="StoragePlan",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=200)),
|
|
("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="storage_plans",
|
|
to="services.cloudprovider",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="StoragePlanPrice",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"currency",
|
|
models.CharField(
|
|
choices=[
|
|
("CHF", "Swiss Franc"),
|
|
("EUR", "Euro"),
|
|
("USD", "US Dollar"),
|
|
],
|
|
max_length=3,
|
|
),
|
|
),
|
|
(
|
|
"amount",
|
|
models.DecimalField(
|
|
decimal_places=2,
|
|
help_text="Price in the specified currency, excl. VAT",
|
|
max_digits=10,
|
|
),
|
|
),
|
|
(
|
|
"storage_plan",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="prices",
|
|
to="services.storageplan",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["currency"],
|
|
"unique_together": {("storage_plan", "currency")},
|
|
},
|
|
),
|
|
]
|