aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'pyblackbird_cc/payments/migrations')
-rw-r--r--pyblackbird_cc/payments/migrations/0001_initial.py103
-rw-r--r--pyblackbird_cc/payments/migrations/0002_subscriptionplan_and_more.py36
-rw-r--r--pyblackbird_cc/payments/migrations/0003_product_price.py53
-rw-r--r--pyblackbird_cc/payments/migrations/0004_rename_stripe_product_id_price_stripe_price_id.py18
-rw-r--r--pyblackbird_cc/payments/migrations/__init__.py0
5 files changed, 210 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")},
+ },
+ ),
+ ]
diff --git a/pyblackbird_cc/payments/migrations/0002_subscriptionplan_and_more.py b/pyblackbird_cc/payments/migrations/0002_subscriptionplan_and_more.py
new file mode 100644
index 0000000..cab49b5
--- /dev/null
+++ b/pyblackbird_cc/payments/migrations/0002_subscriptionplan_and_more.py
@@ -0,0 +1,36 @@
+# Generated by Django 5.0.4 on 2024-09-03 19:32
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("payments", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="SubscriptionPlan",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("name", models.CharField(max_length=255)),
+ ("price", models.DecimalField(decimal_places=2, max_digits=6)),
+ ("description", models.TextField()),
+ ("allowed_downloads", models.PositiveIntegerField()),
+ ("stripe_plan_id", models.CharField(max_length=255)),
+ ],
+ ),
+ migrations.RemoveField(
+ model_name="subscription",
+ name="stripe_subscription_id",
+ ),
+ ]
diff --git a/pyblackbird_cc/payments/migrations/0003_product_price.py b/pyblackbird_cc/payments/migrations/0003_product_price.py
new file mode 100644
index 0000000..b12d5dc
--- /dev/null
+++ b/pyblackbird_cc/payments/migrations/0003_product_price.py
@@ -0,0 +1,53 @@
+# Generated by Django 5.0.4 on 2024-09-04 19:01
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("payments", "0002_subscriptionplan_and_more"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="Product",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("name", models.CharField(max_length=255)),
+ ("stripe_product_id", models.CharField(max_length=100)),
+ ],
+ ),
+ migrations.CreateModel(
+ name="Price",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("price", models.IntegerField(default=0)),
+ ("stripe_product_id", models.CharField(max_length=100)),
+ (
+ "product",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ to="payments.product",
+ ),
+ ),
+ ],
+ ),
+ ]
diff --git a/pyblackbird_cc/payments/migrations/0004_rename_stripe_product_id_price_stripe_price_id.py b/pyblackbird_cc/payments/migrations/0004_rename_stripe_product_id_price_stripe_price_id.py
new file mode 100644
index 0000000..e5a339f
--- /dev/null
+++ b/pyblackbird_cc/payments/migrations/0004_rename_stripe_product_id_price_stripe_price_id.py
@@ -0,0 +1,18 @@
+# Generated by Django 5.0.4 on 2024-09-04 19:17
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("payments", "0003_product_price"),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name="price",
+ old_name="stripe_product_id",
+ new_name="stripe_price_id",
+ ),
+ ]
diff --git a/pyblackbird_cc/payments/migrations/__init__.py b/pyblackbird_cc/payments/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pyblackbird_cc/payments/migrations/__init__.py