# Generated by Django 5.2.1 on 2025-07-22 20:58

import datetime
import django.contrib.auth.models
import django.contrib.auth.validators
import django.contrib.postgres.fields
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Compound',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('aliases', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None, verbose_name='Aliases')),
            ],
        ),
        migrations.CreateModel(
            name='EPModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_%(app_label)s.%(class)s_set+', to='contenttypes.contenttype')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='Permission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('permission', models.CharField(choices=[('read', 'Read'), ('write', 'Write'), ('all', 'All')], max_length=32)),
            ],
        ),
        migrations.CreateModel(
            name='License',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('link', models.URLField(verbose_name='link')),
                ('image_link', models.URLField(verbose_name='Image link')),
            ],
        ),
        migrations.CreateModel(
            name='Rule',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('aliases', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None, verbose_name='Aliases')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='APIToken',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hashed_key', models.CharField(max_length=128, unique=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('expires_at', models.DateTimeField(blank=True, default=datetime.datetime(2025, 10, 20, 20, 58, 48, 351675, tzinfo=datetime.timezone.utc), null=True)),
                ('name', models.CharField(blank=True, help_text='Optional name for the token', max_length=100)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CompoundStructure',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('aliases', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None, verbose_name='Aliases')),
                ('smiles', models.TextField(verbose_name='SMILES')),
                ('canonical_smiles', models.TextField(verbose_name='Canonical SMILES')),
                ('inchikey', models.TextField(max_length=27, verbose_name='InChIKey')),
                ('normalized_structure', models.BooleanField(default=False)),
                ('compound', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.compound')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='compound',
            name='default_structure',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='compound_default_structure', to='epdb.compoundstructure', verbose_name='Default Structure'),
        ),
        migrations.CreateModel(
            name='Edge',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('aliases', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None, verbose_name='Aliases')),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_%(app_label)s.%(class)s_set+', to='contenttypes.contenttype')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='EnviFormer',
            fields=[
                ('epmodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.epmodel')),
                ('threshold', models.FloatField(default=0.5)),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.epmodel',),
        ),
        migrations.CreateModel(
            name='PluginModel',
            fields=[
                ('epmodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.epmodel')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.epmodel',),
        ),
        migrations.CreateModel(
            name='RuleBaseRelativeReasoning',
            fields=[
                ('epmodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.epmodel')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.epmodel',),
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(verbose_name='Group name')),
                ('public', models.BooleanField(default=False, verbose_name='Public Group')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('group_member', models.ManyToManyField(related_name='groups_in_group', to='epdb.group', verbose_name='Group member')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Group Owner')),
                ('user_member', models.ManyToManyField(related_name='users_in_group', to=settings.AUTH_USER_MODEL, verbose_name='User members')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='user',
            name='default_group',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_group', to='epdb.group', verbose_name='Default Group'),
        ),
        migrations.CreateModel(
            name='Node',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('aliases', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None, verbose_name='Aliases')),
                ('depth', models.IntegerField(verbose_name='Node depth')),
                ('default_node_label', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='default_node_structure', to='epdb.compoundstructure', verbose_name='Default Node Label')),
                ('node_labels', models.ManyToManyField(related_name='node_structures', to='epdb.compoundstructure', verbose_name='All Node Labels')),
                ('out_edges', models.ManyToManyField(to='epdb.edge', verbose_name='Outgoing Edges')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='edge',
            name='end_nodes',
            field=models.ManyToManyField(related_name='edge_products', to='epdb.node', verbose_name='End Nodes'),
        ),
        migrations.AddField(
            model_name='edge',
            name='start_nodes',
            field=models.ManyToManyField(related_name='edge_educts', to='epdb.node', verbose_name='Start Nodes'),
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('reviewed', models.BooleanField(default=False, verbose_name='Reviewstatus')),
                ('license', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='epdb.license', verbose_name='License')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='epmodel',
            name='package',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Package'),
        ),
        migrations.AddField(
            model_name='compound',
            name='package',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Package'),
        ),
        migrations.AddField(
            model_name='user',
            name='default_package',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='epdb.package', verbose_name='Default Package'),
        ),
        migrations.CreateModel(
            name='SequentialRule',
            fields=[
                ('rule_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.rule')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.rule',),
        ),
        migrations.CreateModel(
            name='SimpleRule',
            fields=[
                ('rule_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.rule')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.rule',),
        ),
        migrations.AddField(
            model_name='rule',
            name='package',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Package'),
        ),
        migrations.AddField(
            model_name='rule',
            name='polymorphic_ctype',
            field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_%(app_label)s.%(class)s_set+', to='contenttypes.contenttype'),
        ),
        migrations.CreateModel(
            name='Pathway',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('aliases', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None, verbose_name='Aliases')),
                ('package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Package')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='node',
            name='pathway',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.pathway', verbose_name='belongs to'),
        ),
        migrations.AddField(
            model_name='edge',
            name='pathway',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.pathway', verbose_name='belongs to'),
        ),
        migrations.CreateModel(
            name='Reaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('aliases', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), default=list, size=None, verbose_name='Aliases')),
                ('multi_step', models.BooleanField(verbose_name='Multistep Reaction')),
                ('medline_references', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), null=True, size=None, verbose_name='Medline References')),
                ('educts', models.ManyToManyField(related_name='reaction_educts', to='epdb.compoundstructure', verbose_name='Educts')),
                ('package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Package')),
                ('products', models.ManyToManyField(related_name='reaction_products', to='epdb.compoundstructure', verbose_name='Products')),
                ('rules', models.ManyToManyField(related_name='reaction_rule', to='epdb.rule', verbose_name='Rule')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='edge',
            name='edge_label',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='epdb.reaction', verbose_name='Edge label'),
        ),
        migrations.CreateModel(
            name='Scenario',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('scenario_date', models.CharField(default='No date', max_length=256)),
                ('scenario_type', models.CharField(default='Not specified', max_length=256)),
                ('additional_information', models.JSONField(verbose_name='Additional Information')),
                ('package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Package')),
                ('parent', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='epdb.scenario')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='rule',
            name='scenarios',
            field=models.ManyToManyField(to='epdb.scenario', verbose_name='Attached Scenarios'),
        ),
        migrations.AddField(
            model_name='reaction',
            name='scenarios',
            field=models.ManyToManyField(to='epdb.scenario', verbose_name='Attached Scenarios'),
        ),
        migrations.AddField(
            model_name='pathway',
            name='scenarios',
            field=models.ManyToManyField(to='epdb.scenario', verbose_name='Attached Scenarios'),
        ),
        migrations.AddField(
            model_name='node',
            name='scenarios',
            field=models.ManyToManyField(to='epdb.scenario', verbose_name='Attached Scenarios'),
        ),
        migrations.AddField(
            model_name='edge',
            name='scenarios',
            field=models.ManyToManyField(to='epdb.scenario', verbose_name='Attached Scenarios'),
        ),
        migrations.AddField(
            model_name='compoundstructure',
            name='scenarios',
            field=models.ManyToManyField(to='epdb.scenario', verbose_name='Attached Scenarios'),
        ),
        migrations.AddField(
            model_name='compound',
            name='scenarios',
            field=models.ManyToManyField(to='epdb.scenario', verbose_name='Attached Scenarios'),
        ),
        migrations.CreateModel(
            name='Setting',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('public', models.BooleanField(default=False)),
                ('global_default', models.BooleanField(default=False)),
                ('max_depth', models.IntegerField(default=5, verbose_name='Setting Max Depth')),
                ('max_nodes', models.IntegerField(default=30, verbose_name='Setting Max Number of Nodes')),
                ('model_threshold', models.FloatField(blank=True, default=0.25, null=True, verbose_name='Setting Model Threshold')),
                ('model', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='epdb.epmodel', verbose_name='Setting EPModel')),
                ('rule_packages', models.ManyToManyField(blank=True, related_name='setting_rule_packages', to='epdb.package', verbose_name='Setting Rule Packages')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='pathway',
            name='setting',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='epdb.setting', verbose_name='Setting'),
        ),
        migrations.AddField(
            model_name='user',
            name='default_setting',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='epdb.setting', verbose_name='The users default settings'),
        ),
        migrations.CreateModel(
            name='MLRelativeReasoning',
            fields=[
                ('epmodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.epmodel')),
                ('threshold', models.FloatField(default=0.5)),
                ('model_status', models.CharField(choices=[('INITIAL', 'Initial'), ('INITIALIZING', 'Model is initializing.'), ('BUILDING', 'Model is building.'), ('BUILT_NOT_EVALUATED', 'Model is built and can be used for predictions, Model is not evaluated yet.'), ('EVALUATING', 'Model is evaluating'), ('FINISHED', 'Model has finished building and evaluation.'), ('ERROR', 'Model has failed.')], default='INITIAL')),
                ('eval_results', models.JSONField(blank=True, default=dict, null=True)),
                ('data_packages', models.ManyToManyField(related_name='data_packages', to='epdb.package', verbose_name='Data Packages')),
                ('eval_packages', models.ManyToManyField(related_name='eval_packages', to='epdb.package', verbose_name='Evaluation Packages')),
                ('rule_packages', models.ManyToManyField(related_name='rule_packages', to='epdb.package', verbose_name='Rule Packages')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.epmodel',),
        ),
        migrations.CreateModel(
            name='ApplicabilityDomain',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('uuid', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='UUID of this object')),
                ('name', models.TextField(default='no name', verbose_name='Name')),
                ('description', models.TextField(default='no description', verbose_name='Descriptions')),
                ('kv', models.JSONField(blank=True, default=dict, null=True)),
                ('num_neighbours', models.FloatField(default=5)),
                ('reliability_threshold', models.FloatField(default=0.5)),
                ('local_compatibilty_threshold', models.FloatField(default=0.5)),
                ('model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.mlrelativereasoning')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SimpleAmbitRule',
            fields=[
                ('simplerule_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.simplerule')),
                ('smirks', models.TextField(verbose_name='SMIRKS')),
                ('reactant_filter_smarts', models.TextField(null=True, verbose_name='Reactant Filter SMARTS')),
                ('product_filter_smarts', models.TextField(null=True, verbose_name='Product Filter SMARTS')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.simplerule',),
        ),
        migrations.CreateModel(
            name='SimpleRDKitRule',
            fields=[
                ('simplerule_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.simplerule')),
                ('reaction_smarts', models.TextField(verbose_name='SMIRKS')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.simplerule',),
        ),
        migrations.CreateModel(
            name='SequentialRuleOrdering',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_index', models.IntegerField()),
                ('sequential_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.sequentialrule')),
                ('simple_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.simplerule')),
            ],
        ),
        migrations.AddField(
            model_name='sequentialrule',
            name='simple_rules',
            field=models.ManyToManyField(through='epdb.SequentialRuleOrdering', to='epdb.simplerule', verbose_name='Simple rules'),
        ),
        migrations.CreateModel(
            name='ParallelRule',
            fields=[
                ('rule_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='epdb.rule')),
                ('simple_rules', models.ManyToManyField(to='epdb.simplerule', verbose_name='Simple rules')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('epdb.rule',),
        ),
        migrations.AlterUniqueTogether(
            name='compound',
            unique_together={('uuid', 'package')},
        ),
        migrations.CreateModel(
            name='GroupPackagePermission',
            fields=[
                ('permission_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='epdb.permission')),
                ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='UUID of this object')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.group', verbose_name='Permission to')),
                ('package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Permission on')),
            ],
            options={
                'unique_together': {('package', 'group')},
            },
            bases=('epdb.permission',),
        ),
        migrations.CreateModel(
            name='UserPackagePermission',
            fields=[
                ('permission_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='epdb.permission')),
                ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='UUID of this object')),
                ('package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.package', verbose_name='Permission on')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Permission to')),
            ],
            options={
                'unique_together': {('package', 'user')},
            },
            bases=('epdb.permission',),
        ),
        migrations.CreateModel(
            name='UserSettingPermission',
            fields=[
                ('permission_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='epdb.permission')),
                ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='UUID of this object')),
                ('setting', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epdb.setting', verbose_name='Permission on')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Permission to')),
            ],
            options={
                'unique_together': {('setting', 'user')},
            },
            bases=('epdb.permission',),
        ),
    ]
