# Generated by Django 4.2.7 on 2025-04-07 17:38

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

from simmate.apps.rdkit.utils import get_rdkit_ext_fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("emolecules", "0001_setup"),
    ]

    operations = [
        migrations.CreateModel(
            name="EmoleculesMolecule",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, db_index=True, null=True),
                ),
                ("molecule", models.TextField(blank=True, null=True)),
                ("molecule_original", models.TextField(blank=True, null=True)),
                ("is_3d", models.BooleanField(blank=True, null=True)),
                ("smiles", models.TextField(blank=True, null=True)),
                ("inchi", models.TextField(blank=True, null=True)),
                (
                    "inchi_key",
                    models.CharField(
                        blank=True, db_index=True, max_length=30, null=True
                    ),
                ),
                ("num_atoms", models.IntegerField(blank=True, null=True)),
                ("num_stereocenters", models.IntegerField(blank=True, null=True)),
                ("num_rings", models.IntegerField(blank=True, null=True)),
                ("num_h_acceptors", models.IntegerField(blank=True, null=True)),
                ("num_h_donors", models.IntegerField(blank=True, null=True)),
                ("molecular_weight", models.FloatField(blank=True, null=True)),
                ("molecular_weight_exact", models.FloatField(blank=True, null=True)),
                ("functional_groups", models.JSONField(blank=True, null=True)),
                ("log_p_rdkit", models.FloatField(blank=True, null=True)),
                ("tpsa_rdkit", models.FloatField(blank=True, null=True)),
                ("synthetic_accessibility", models.FloatField(blank=True, null=True)),
                *get_rdkit_ext_fields(),
                ("emol_parent_id", models.IntegerField(blank=True, null=True)),
                (
                    "is_active_listing",
                    models.BooleanField(blank=True, default=True, null=True),
                ),
                (
                    "is_building_block",
                    models.BooleanField(blank=True, default=False, null=True),
                ),
                ("cas_number_original", models.TextField(blank=True, null=True)),
                ("mfcd", models.TextField(blank=True, null=True)),
            ],
            options={
                "db_table": "emolecules__molecules",
            },
        ),
        migrations.CreateModel(
            name="EmoleculesSupplierOffer",
            fields=[
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, db_index=True, null=True),
                ),
                (
                    "id",
                    models.CharField(max_length=32, primary_key=True, serialize=False),
                ),
                ("supplier_name", models.TextField(blank=True, null=True)),
                ("supplier_compound_id", models.TextField(blank=True, null=True)),
                ("grams_per_unit", models.FloatField(blank=True, null=True)),
                ("price_per_unit", models.FloatField(blank=True, null=True)),
                ("price_per_gram", models.FloatField(blank=True, null=True)),
                ("tier_number", models.IntegerField(blank=True, null=True)),
                ("sku", models.IntegerField(blank=True, null=True)),
                (
                    "compound",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="vendor_offers",
                        to="emolecules.emoleculesmolecule",
                    ),
                ),
            ],
            options={
                "db_table": "emolecules__supplier_offers",
            },
        ),
    ]
