# Generated by Django 4.2 on 2025-06-22 11:14

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='FormulaCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('prefix', models.PositiveIntegerField(unique=True)),
            ],
            options={
                'verbose_name': 'Kategoria wzoru',
                'verbose_name_plural': 'Kategorie wzorów',
            },
        ),
        migrations.CreateModel(
            name='Symbol',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('symbol_id', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=255)),
                ('unit', models.CharField(max_length=50)),
                ('description', models.TextField(blank=True)),
                ('tags', models.JSONField(blank=True, default=list)),
                ('revision', models.PositiveIntegerField(default=1)),
                ('code', models.CharField(editable=False, max_length=10, unique=True)),
                ('meta', models.TextField(blank=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='formulas.formulacategory')),
            ],
        ),
        migrations.CreateModel(
            name='Formula',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('formula_id', models.CharField(max_length=100)),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('meta', models.TextField(blank=True)),
                ('tags', models.JSONField(default=list)),
                ('latex', models.TextField()),
                ('raw_latex', models.TextField()),
                ('variables', models.JSONField(default=list)),
                ('calculator', models.CharField(max_length=100)),
                ('revision', models.PositiveIntegerField(default=1)),
                ('code', models.CharField(editable=False, max_length=10, unique=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='formulas.formulacategory')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
