# Generated by Django 4.1.1 on 2023-02-03 14:39

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("djwebdapp_tezos", "0005_tezoscall_tezoscontract"),
        ("djwebdapp_multisig", "0001_initial"),
        ("djwebdapp", "0013_transaction_normalized_dependency"),
    ]

    operations = [
        migrations.CreateModel(
            name="Fa2Contract",
            fields=[
                (
                    "tezostransaction_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="djwebdapp_tezos.tezostransaction",
                    ),
                ),
                ("metadata_uri", models.CharField(max_length=500)),
                (
                    "manager",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="fa2_administered",
                        to="djwebdapp.account",
                    ),
                ),
                (
                    "multisig",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="djwebdapp_multisig.multisigcontract",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=("djwebdapp_tezos.tezoscontract",),
        ),
        migrations.CreateModel(
            name="UpdateProxyCall",
            fields=[
                (
                    "tezostransaction_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="djwebdapp_tezos.tezostransaction",
                    ),
                ),
                ("remove_proxy", models.BooleanField(default=False)),
                (
                    "proxy",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="fa2contract_proxy_set",
                        to="djwebdapp.account",
                    ),
                ),
            ],
            bases=("djwebdapp_tezos.tezoscall",),
        ),
        migrations.CreateModel(
            name="MintCall",
            fields=[
                (
                    "tezostransaction_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="djwebdapp_tezos.tezostransaction",
                    ),
                ),
                ("token_id", models.PositiveBigIntegerField()),
                ("token_amount", models.PositiveBigIntegerField()),
                ("metadata_uri", models.CharField(max_length=500)),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="mintcall_owner_set",
                        to="djwebdapp.account",
                    ),
                ),
            ],
            bases=("djwebdapp_tezos.tezoscall",),
        ),
        migrations.CreateModel(
            name="Fa2Token",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("token_id", models.IntegerField()),
                ("metadata_uri", models.CharField(max_length=500)),
                (
                    "contract",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djwebdapp_fa2.fa2contract",
                    ),
                ),
            ],
            options={
                "unique_together": {("token_id", "contract")},
            },
        ),
        migrations.CreateModel(
            name="Balance",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("amount", models.PositiveBigIntegerField(default=0)),
                (
                    "account",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="fa2_balances",
                        to="djwebdapp.account",
                    ),
                ),
                (
                    "token",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djwebdapp_fa2.fa2token",
                    ),
                ),
            ],
            options={
                "unique_together": {("token", "account")},
            },
        ),
    ]
