Files
goodtimes/manage_coupons/migrations/0001_initial.py
2024-07-22 21:08:56 +05:30

82 lines
2.8 KiB
Python

# Generated by Django 5.0.2 on 2024-07-22 12:20
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
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",
),
),
("active", models.BooleanField(default=True)),
("deleted", models.BooleanField(default=False)),
("created_on", models.DateTimeField(auto_now_add=True)),
("modified_on", models.DateTimeField(auto_now=True)),
("title", models.CharField(max_length=255)),
("coupon_code", models.CharField(max_length=50, unique=True)),
("no_of_redeems", models.IntegerField(default=0)),
("description", models.TextField(blank=True, null=True)),
(
"image",
models.ImageField(blank=True, null=True, upload_to="coupon_img"),
),
(
"discount_amount",
models.DecimalField(
blank=True, decimal_places=2, max_digits=10, null=True
),
),
(
"discount_percentage",
models.DecimalField(
blank=True, decimal_places=2, max_digits=5, null=True
),
),
("valid_from", models.DateTimeField()),
("valid_to", models.DateTimeField()),
("max_redeems", models.IntegerField(default=0)),
(
"created_by",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="%(class)s_created",
to=settings.AUTH_USER_MODEL,
),
),
(
"modified_by",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="%(class)s_modified",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"db_table": "coupon",
},
),
]