# Generated by Django 5.1.5 on 2025-03-10 11:38

import django.contrib.postgres.indexes
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("core", "0002_initial"),
        ("payments", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name="balance",
            name="user",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="payments_balance",
                to=settings.AUTH_USER_MODEL,
                blank=True,
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="transaction",
            name="balance",
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="payments.balance"),
        ),
        migrations.AddField(
            model_name="transaction",
            name="order",
            field=models.ForeignKey(
                blank=True,
                help_text="order to process after paid",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="payments_transactions",
                to="core.order",
            ),
        ),
        migrations.AddIndex(
            model_name="transaction",
            index=django.contrib.postgres.indexes.GinIndex(fields=["process"], name="payments_tr_process_d5b008_gin"),
        ),
    ]
