# Generated by Django 5.0.7 on 2024-07-25 16:06

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('library', '0001_initial'),
        ('rsform', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Operation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('operation_type', models.CharField(choices=[('input', 'Input'), ('synthesis', 'Synthesis')], default='input', max_length=10, verbose_name='Тип')),
                ('sync_text', models.BooleanField(default=True, verbose_name='Синхронизация')),
                ('alias', models.CharField(blank=True, max_length=255, verbose_name='Шифр')),
                ('title', models.TextField(blank=True, verbose_name='Название')),
                ('comment', models.TextField(blank=True, verbose_name='Комментарий')),
                ('position_x', models.FloatField(default=0, verbose_name='Положение по горизонтали')),
                ('position_y', models.FloatField(default=0, verbose_name='Положение по вертикали')),
                ('oss', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='library.libraryitem', verbose_name='Схема синтеза')),
                ('result', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='producer', to='library.libraryitem', verbose_name='Связанная КС')),
            ],
            options={
                'verbose_name': 'Операция',
                'verbose_name_plural': 'Операции',
            },
        ),
        migrations.CreateModel(
            name='Substitution',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transfer_term', models.BooleanField(default=False, verbose_name='Перенос термина')),
                ('operation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oss.operation', verbose_name='Операция')),
                ('original', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='as_original', to='rsform.constituenta', verbose_name='Удаляемая конституента')),
                ('substitution', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='as_substitute', to='rsform.constituenta', verbose_name='Замещающая конституента')),
            ],
            options={
                'verbose_name': 'Отождествление синтеза',
                'verbose_name_plural': 'Таблицы отождествлений',
            },
        ),
        migrations.CreateModel(
            name='Argument',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('argument', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='descendants', to='oss.operation', verbose_name='Аргумент')),
                ('operation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arguments', to='oss.operation', verbose_name='Операция')),
            ],
            options={
                'verbose_name': 'Аргумент',
                'verbose_name_plural': 'Аргументы операций',
                'unique_together': {('operation', 'argument')},
            },
        ),
    ]
