aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments/migrations/0001_initial.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyblackbird_cc/payments/migrations/0001_initial.py')
-rw-r--r--pyblackbird_cc/payments/migrations/0001_initial.py103
1 files changed, 103 insertions, 0 deletions
diff --git a/pyblackbird_cc/payments/migrations/0001_initial.py b/pyblackbird_cc/payments/migrations/0001_initial.py
new file mode 100644
index 0000000..33b7602
--- /dev/null
+++ b/pyblackbird_cc/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")},
+ },
+ ),
+ ]