# Generated by Django 5.2.5 on 2025-08-22 11:50

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=254)),
                ('bio', models.JSONField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('color', models.CharField(default='#000000', max_length=7)),
            ],
        ),
        migrations.CreateModel(
            name='ConcreteResource',
            fields=[
                ('key', models.CharField(db_index=True, max_length=255, primary_key=True, serialize=False)),
                ('mime_type', models.CharField(blank=True, max_length=100)),
                ('data_type', models.CharField(blank=True, choices=[('text', 'Text'), ('blob', 'Blob')], max_length=10)),
                ('blob_data', models.FileField(blank=True, null=True, upload_to='resource_blobs/')),
                ('text_data', models.TextField(blank=True)),
                ('metadata', models.JSONField(blank=True, null=True)),
                ('target_spec', models.JSONField(blank=True, null=True)),
                ('target_object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('status', models.CharField(choices=[('seeded', 'Seeded'), ('extracted', 'Extracted'), ('mined', 'Mined'), ('transformed', 'Transformed'), ('loaded', 'Loaded')], default='seeded', max_length=20)),
                ('seeded_at', models.DateTimeField(auto_now_add=True, null=True)),
                ('extracted_at', models.DateTimeField(blank=True, null=True)),
                ('mined_at', models.DateTimeField(blank=True, null=True)),
                ('transformed_at', models.DateTimeField(blank=True, null=True)),
                ('loaded_at', models.DateTimeField(blank=True, null=True)),
                ('last_error', models.TextField(blank=True)),
                ('dependencies', models.ManyToManyField(blank=True, related_name='dependent_resources', to='testapp.concreteresource')),
                ('target_content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
            ],
            options={
                'verbose_name': 'Concrete Resource',
                'verbose_name_plural': 'Concrete Resources',
            },
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('content', models.TextField()),
                ('metadata', models.JSONField(blank=True, null=True)),
                ('published_date', models.DateTimeField(auto_now_add=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='testapp.author')),
                ('tags', models.ManyToManyField(blank=True, to='testapp.tag')),
            ],
        ),
    ]
