Skip to content

Commit

Permalink
Added timestamp and updated to user sub model
Browse files Browse the repository at this point in the history
  • Loading branch information
codingforentrepreneurs committed Jun 7, 2024
1 parent 87668f8 commit 1c9533b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.0.6 on 2024-06-07 19:23

import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("subscriptions", "0021_usersubscription_cancel_at_period_end"),
]

operations = [
migrations.AddField(
model_name="usersubscription",
name="timestamp",
field=models.DateTimeField(
auto_now_add=True, default=django.utils.timezone.now
),
preserve_default=False,
),
migrations.AddField(
model_name="usersubscription",
name="updated",
field=models.DateTimeField(auto_now=True),
),
]
2 changes: 2 additions & 0 deletions src/subscriptions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ class UserSubscription(models.Model):
current_period_end = models.DateTimeField(auto_now=False, auto_now_add=False, blank=True, null=True)
cancel_at_period_end = models.BooleanField(default=False)
status = models.CharField(max_length=20, choices=SubscriptionStatus.choices, null=True, blank=True)
timestamp = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)

objects = UserSubscriptionManager()

Expand Down

0 comments on commit 1c9533b

Please sign in to comment.