Spaces:
Runtime error
Runtime error
# Generated by Django 4.2.16 on 2024-10-24 12:52 | |
import authentication.models | |
from django.conf import settings | |
from django.db import migrations, models | |
import django.db.models.deletion | |
class Migration(migrations.Migration): | |
initial = True | |
dependencies = [ | |
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | |
] | |
operations = [ | |
migrations.CreateModel( | |
name="Coupon", | |
fields=[ | |
( | |
"id", | |
models.BigAutoField( | |
auto_created=True, | |
primary_key=True, | |
serialize=False, | |
verbose_name="ID", | |
), | |
), | |
("name", models.CharField(max_length=50)), | |
("pointsNeededForRedemption", models.IntegerField()), | |
( | |
"couponCode", | |
models.CharField( | |
default=authentication.models.Coupon.randomCouponCode, | |
max_length=50, | |
), | |
), | |
( | |
"loyaltyCode", | |
models.CharField( | |
default=authentication.models.Coupon.randomLoyaltyCode, | |
max_length=50, | |
), | |
), | |
("discount", models.IntegerField()), | |
("isExpired", models.BooleanField(default=False)), | |
("expiryDate", models.DateTimeField()), | |
( | |
"discountFunction", | |
models.IntegerField( | |
choices=[ | |
(0, "CORE"), | |
(1, "CUSTOMER"), | |
(2, "LOYALTY"), | |
(3, "GIFT_WITH_PURCHASE"), | |
], | |
default=2, | |
), | |
), | |
( | |
"discountMethod", | |
models.IntegerField( | |
choices=[ | |
(0, "POINT_REDEMPTION"), | |
(1, "REDEEMED"), | |
(2, "GIVE_AWAY"), | |
(3, "BONUS_COUPON"), | |
(4, "VOUCHER_GENERIC"), | |
(5, "VOUCHER_LOYALTY"), | |
(6, "VOUCHER_FUEL"), | |
(7, "VOUCHER_THIRDPARTY"), | |
], | |
default=0, | |
), | |
), | |
( | |
"discountType", | |
models.IntegerField( | |
choices=[ | |
(0, "AMOUNT"), | |
(1, "PERCENT"), | |
(2, "RE_PRICE"), | |
(3, "ALT_PRICE"), | |
], | |
default=0, | |
), | |
), | |
( | |
"howOftenApply", | |
models.IntegerField( | |
choices=[ | |
(0, "ALL_APPLICABLE"), | |
(1, "ONCE_PER_ORDER"), | |
(2, "ONCE_PER_SELECTION"), | |
], | |
default=1, | |
), | |
), | |
( | |
"qualificationType", | |
models.IntegerField( | |
choices=[(0, "ALL"), (1, "ITEM"), (2, "ORDER")], default=2 | |
), | |
), | |
( | |
"rewardsType", | |
models.IntegerField( | |
choices=[(0, "PURCHASES"), (1, "ITEMS"), (2, "VISIT")], | |
default=0, | |
), | |
), | |
], | |
), | |
migrations.CreateModel( | |
name="UserData", | |
fields=[ | |
( | |
"id", | |
models.BigAutoField( | |
auto_created=True, | |
primary_key=True, | |
serialize=False, | |
verbose_name="ID", | |
), | |
), | |
("phone", models.CharField(max_length=15)), | |
("birthDate", models.DateField()), | |
("gender", models.CharField(max_length=10)), | |
("streetName", models.CharField(max_length=50)), | |
("city", models.CharField(max_length=50)), | |
("state", models.CharField(max_length=50)), | |
("country", models.CharField(max_length=50)), | |
("pincode", models.IntegerField()), | |
("otp", models.IntegerField()), | |
("rewardPoints", models.IntegerField(default=0)), | |
("isVerified", models.BooleanField(default=False)), | |
("isSubscribed", models.BooleanField(default=False)), | |
("isBlocked", models.BooleanField(default=False)), | |
("isDeleted", models.BooleanField(default=False)), | |
("coupons", models.ManyToManyField(to="authentication.coupon")), | |
( | |
"user", | |
models.ForeignKey( | |
on_delete=django.db.models.deletion.CASCADE, | |
to=settings.AUTH_USER_MODEL, | |
), | |
), | |
], | |
), | |
] | |