From 863c218913fdb0627a3b4e10200745e7796c01e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 18 Dec 2024 11:30:18 +0100 Subject: [PATCH] feat: track customer creation timestamp --- .../0017_alter_invoiceitem_package.py | 26 +++++++++++++++++++ .../migrations/0041_customer_created.py | 21 +++++++++++++++ weblate_web/payments/models.py | 1 + 3 files changed, 48 insertions(+) create mode 100644 weblate_web/invoices/migrations/0017_alter_invoiceitem_package.py create mode 100644 weblate_web/payments/migrations/0041_customer_created.py diff --git a/weblate_web/invoices/migrations/0017_alter_invoiceitem_package.py b/weblate_web/invoices/migrations/0017_alter_invoiceitem_package.py new file mode 100644 index 000000000..cfc3eed3d --- /dev/null +++ b/weblate_web/invoices/migrations/0017_alter_invoiceitem_package.py @@ -0,0 +1,26 @@ +# Generated by Django 5.1.3 on 2024-12-18 10:29 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("invoices", "0016_alter_invoice_category_and_more"), + ("weblate_web", "0037_package_hidden"), + ] + + operations = [ + migrations.AlterField( + model_name="invoiceitem", + name="package", + field=models.ForeignKey( + blank=True, + help_text="Selecting package will automatically fill in description and price", + limit_choices_to={"hidden": False}, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="weblate_web.package", + ), + ), + ] diff --git a/weblate_web/payments/migrations/0041_customer_created.py b/weblate_web/payments/migrations/0041_customer_created.py new file mode 100644 index 000000000..ad2033e35 --- /dev/null +++ b/weblate_web/payments/migrations/0041_customer_created.py @@ -0,0 +1,21 @@ +# Generated by Django 5.1.3 on 2024-12-18 10:29 + +import django.utils.timezone +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("payments", "0040_fill_in_users"), + ] + + operations = [ + migrations.AddField( + model_name="customer", + name="created", + field=models.DateTimeField( + auto_now_add=True, default=django.utils.timezone.now + ), + preserve_default=False, + ), + ] diff --git a/weblate_web/payments/models.py b/weblate_web/payments/models.py index 563ba5f0f..189eacf47 100644 --- a/weblate_web/payments/models.py +++ b/weblate_web/payments/models.py @@ -150,6 +150,7 @@ class Customer(models.Model): null=True, ) users = models.ManyToManyField(User) + created = models.DateTimeField(auto_now_add=True) objects = CustomerQuerySet.as_manager()