diff options
Diffstat (limited to 'alphabetlearning/payments/migrations/0001_initial.py')
-rw-r--r-- | alphabetlearning/payments/migrations/0001_initial.py | 138 |
1 files changed, 61 insertions, 77 deletions
diff --git a/alphabetlearning/payments/migrations/0001_initial.py b/alphabetlearning/payments/migrations/0001_initial.py index 33b7602..136aef1 100644 --- a/alphabetlearning/payments/migrations/0001_initial.py +++ b/alphabetlearning/payments/migrations/0001_initial.py @@ -1,7 +1,7 @@ -# Generated by Django 5.0.4 on 2024-09-03 19:21 +# Generated by Django 5.1.4 on 2024-12-31 15:26 import django.db.models.deletion -from django.conf import settings +import uuid from django.db import migrations, models @@ -10,94 +10,78 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ("resources", "0019_alter_pdfpagesnapshot_options_and_more"), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('resources', '0001_initial'), ] operations = [ migrations.CreateModel( - name="ShoppingCart", + name='EmailSignup', 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, - ), - ), + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('email', models.EmailField(max_length=254, unique=True)), + ('date_added', models.DateTimeField(auto_now_add=True)), ], ), migrations.CreateModel( - name="Subscription", + name='EmailVerification', 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, - ), - ), + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('email', models.EmailField(max_length=254, unique=True)), + ('verification_token', models.UUIDField(default=uuid.uuid4, editable=False)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('is_verified', models.BooleanField(default=False)), ], ), migrations.CreateModel( - name="CartItem", + name='Product', 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", - ), - ), + ('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='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)), + ], + ), + 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)), + ], + ), + 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()), + ], + ), + migrations.CreateModel( + name='CartItem', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('added_at', models.DateTimeField(auto_now_add=True)), + ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resources.resource')), + ], + ), + 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_price_id', models.CharField(max_length=100)), + ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='price_obj', to='resources.resource')), ], - options={ - "unique_together": {("cart", "resource")}, - }, ), ] |