# Generated by Django 4.1.9 on 2023-06-23 11:51

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


class Migration(migrations.Migration):
    dependencies = [
        ("wbfdm", "0001_initial"),
    ]

    operations = [
        migrations.RenameField(
            model_name="instrumentlookup",
            old_name="statements",
            new_name="financials",
        ),
        migrations.AddField(
            model_name="instrument",
            name="bbg_lookup",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="wbfdm.instrumentidentifier",
                to_fields={
                    "identifier_type": wbfdm.models.fk_fields.RawFieldValue("BBG"),
                    "instrument": wbfdm.models.fk_fields.LocalFieldValue("id"),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrument",
            name="financial_backend",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                to="wbfdm.instrumentlookup",
                to_fields={
                    "financials": wbfdm.models.fk_fields.RawFieldValue(True),
                    "instrument_id": wbfdm.models.fk_fields.LocalFieldValue("id"),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrument",
            name="isin_lookup",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="wbfdm.instrumentidentifier",
                to_fields={
                    "identifier_type": wbfdm.models.fk_fields.RawFieldValue("ISIN"),
                    "instrument": wbfdm.models.fk_fields.LocalFieldValue("id"),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrument",
            name="price_backend",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="+",
                to="wbfdm.instrumentlookup",
                to_fields={
                    "instrument_id": wbfdm.models.fk_fields.LocalFieldValue("id"),
                    "prices": wbfdm.models.fk_fields.RawFieldValue(True),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrument",
            name="ric_lookup",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="wbfdm.instrumentidentifier",
                to_fields={
                    "identifier_type": wbfdm.models.fk_fields.RawFieldValue("RIC"),
                    "instrument": wbfdm.models.fk_fields.LocalFieldValue("id"),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrument",
            name="ticker_lookup",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="wbfdm.instrumentidentifier",
                to_fields={
                    "identifier_type": wbfdm.models.fk_fields.RawFieldValue("TICKER"),
                    "instrument": wbfdm.models.fk_fields.LocalFieldValue("id"),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrument",
            name="valoren_lookup",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="wbfdm.instrumentidentifier",
                to_fields={
                    "identifier_type": wbfdm.models.fk_fields.RawFieldValue("VALOREN"),
                    "instrument": wbfdm.models.fk_fields.LocalFieldValue("id"),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrument",
            name="wkn_lookup",
            field=wbfdm.models.fk_fields.CompositeForeignKey(
                null=True,
                null_if_equal=[],
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="wbfdm.instrumentidentifier",
                to_fields={
                    "identifier_type": wbfdm.models.fk_fields.RawFieldValue("WKN"),
                    "instrument": wbfdm.models.fk_fields.LocalFieldValue("id"),
                },
            ),
        ),
        migrations.AddField(
            model_name="instrumentlookup",
            name="parameters",
            field=models.JSONField(default=dict, null=True),
        ),
    ]
