You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_django/payments/migrations/0001_initial.py

91 lines
3.1 KiB
Python

# Generated by Django 5.2.3 on 2025-07-14 07:49
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("common", "0002_alter_companymodel_short_name_and_more"),
("containers", "0006_containerphotos"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="Payment",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("invoice_number", models.CharField(max_length=50, unique=True)),
("total_amount", models.DecimalField(decimal_places=2, max_digits=10)),
("created_on", models.DateTimeField(auto_now_add=True)),
("paid", models.BooleanField(default=False)),
("paid_on", models.DateTimeField(auto_now_add=True)),
("paid_info", models.TextField(blank=True, null=True)),
(
"description",
models.CharField(blank=True, max_length=255, null=True),
),
(
"company",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="payment_company",
to="common.companymodel",
),
),
(
"created_by",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="payments_user",
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name="PaymentItem",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("amount", models.DecimalField(decimal_places=2, max_digits=10)),
(
"container",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="payment_containers",
to="containers.container",
),
),
(
"payment",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="payment_items",
to="payments.payment",
),
),
],
),
]