diff options
author | Matthew Lemon <y@yulqen.org> | 2024-10-15 21:01:31 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-10-15 21:01:31 +0100 |
commit | eeaddb27560d723ca7d61359744ceb2709fccd2d (patch) | |
tree | 04ddbc49ae7b73d5f5a9e1716d7227aecd3b9f85 /alphabetlearning/payments/migrations/0001_initial.py | |
parent | 7a3044c859043837e6c7c95bb4894d04e9b2cbc2 (diff) |
Renamed from pyblackbird_cc to alphabetlearning - everywhere
Diffstat (limited to 'alphabetlearning/payments/migrations/0001_initial.py')
-rw-r--r-- | alphabetlearning/payments/migrations/0001_initial.py | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/alphabetlearning/payments/migrations/0001_initial.py b/alphabetlearning/payments/migrations/0001_initial.py new file mode 100644 index 0000000..33b7602 --- /dev/null +++ b/alphabetlearning/payments/migrations/0001_initial.py @@ -0,0 +1,103 @@ +# Generated by Django 5.0.4 on 2024-09-03 19:21 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ("resources", "0019_alter_pdfpagesnapshot_options_and_more"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name="ShoppingCart", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("created_at", models.DateTimeField(auto_now_add=True)), + ("updated_at", models.DateTimeField(auto_now=True)), + ( + "user", + models.OneToOneField( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + ), + migrations.CreateModel( + name="Subscription", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("is_active", models.BooleanField(default=False)), + ("start_date", models.DateTimeField(blank=True, null=True)), + ("end_date", models.DateTimeField(blank=True, null=True)), + ( + "stripe_subscription_id", + models.CharField(blank=True, max_length=255, null=True), + ), + ( + "user", + models.OneToOneField( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + ), + migrations.CreateModel( + name="CartItem", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("quantity", models.PositiveIntegerField(default=1)), + ("added_at", models.DateTimeField(auto_now_add=True)), + ( + "resource", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="resources.resource", + ), + ), + ( + "cart", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="items", + to="payments.shoppingcart", + ), + ), + ], + options={ + "unique_together": {("cart", "resource")}, + }, + ), + ] |