Files
goodtimes/manage_wallets/migrations/0001_initial.py
rizwanisready db213d3228 wrong commit
2024-02-29 13:25:50 +05:30

194 lines
6.8 KiB
Python

# Generated by Django 5.0.2 on 2024-02-29 07:47
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("accounts", "0001_initial"),
("manage_subscriptions", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="Transaction",
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)),
(
"transaction_type",
models.CharField(
choices=[
("payment", "Payment"),
("deposit", "Deposit"),
("withdraw", "Withdraw"),
],
max_length=10,
),
),
(
"payment_method",
models.CharField(
choices=[("card", "Card"), ("upi", "UPI")], max_length=10
),
),
(
"transaction_status",
models.CharField(
choices=[
("success", "Success"),
("fail", "Fail"),
("initiate", "Initiate"),
],
default="initiate",
max_length=10,
),
),
(
"amount",
models.DecimalField(decimal_places=2, default=0.0, max_digits=14),
),
("comment", models.CharField(blank=True, max_length=200, null=True)),
(
"order_id",
models.CharField(
blank=True, max_length=255, null=True, unique=True
),
),
(
"product_id",
models.CharField(
blank=True, max_length=255, null=True, unique=True
),
),
(
"reference_id",
models.CharField(blank=True, max_length=255, null=True),
),
(
"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,
),
),
(
"principal",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
(
"principal_subscription",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="transaction_principal_subscription",
to="manage_subscriptions.principalsubscription",
),
),
(
"principal_type",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="transaction_principal_type",
to="accounts.iamprincipaltype",
),
),
],
options={
"db_table": "transaction_history",
},
),
migrations.CreateModel(
name="Wallet",
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)),
(
"balance",
models.DecimalField(decimal_places=2, default=0.0, max_digits=14),
),
(
"deposit",
models.DecimalField(decimal_places=2, default=0.0, max_digits=14),
),
(
"withdrawal_balance",
models.DecimalField(decimal_places=2, default=0.0, max_digits=14),
),
(
"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,
),
),
(
"principal",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"db_table": "wallet",
},
),
]