# Generated by Django 6.0.6 on 2026-07-22 18:21

import apps.candidates.resume_storage
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('candidates', '0013_alter_candidate_resume'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='CandidateAttachment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(storage=apps.candidates.resume_storage.ResumeStorage(), upload_to=apps.candidates.resume_storage.attachment_path)),
                ('original_filename', models.CharField(blank=True, default='', max_length=255)),
                ('content_type', models.CharField(blank=True, default='', max_length=100)),
                ('size', models.PositiveIntegerField(default=0)),
                ('kind', models.CharField(choices=[('resume', 'Résumé'), ('cover_letter', 'Cover Letter'), ('other', 'Other')], db_index=True, default='resume', max_length=20)),
                ('is_primary', models.BooleanField(db_index=True, default=False)),
                ('extracted_text', models.TextField(blank=True, default='')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('candidate', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='candidates.candidate')),
                ('uploaded_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='uploaded_attachments', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'candidate_attachments',
                'ordering': ['-is_primary', '-created_at'],
            },
        ),
    ]
