# Generated by Django 4.2.27 on 2026-01-23 01:53

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Paper',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('openalex_id', models.TextField(blank=True, null=True, unique=True, verbose_name='OpenAlex ID')),
                ('doi', models.TextField(unique=True, verbose_name='DOI')),
                ('type', models.CharField(db_index=True, max_length=20)),
                ('title', models.TextField()),
                ('publication_date', models.DateField(blank=True, null=True)),
                ('publication_year', models.IntegerField(db_index=True)),
                ('first_author', models.TextField(blank=True, null=True)),
                ('first_author_institution', models.TextField(blank=True, null=True)),
                ('publication_name', models.TextField(blank=True, null=True)),
                ('is_oa', models.BooleanField(db_index=True, default=False)),
                ('oa_url', models.TextField(blank=True, null=True)),
                ('has_abstract', models.BooleanField(db_index=True, default=False)),
                ('has_fulltext', models.BooleanField(db_index=True, default=False)),
                ('fetch_status', models.CharField(db_index=True, default='meta_only', max_length=20)),
                ('fail_reason', models.CharField(blank=True, max_length=50, null=True)),
                ('source', models.CharField(default='openalex', max_length=20, verbose_name='元数据来源')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PaperAbstract',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('abstract', models.TextField()),
                ('source', models.CharField(max_length=20, verbose_name='摘要来源')),
                ('paper', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='abstract', to='resm.paper')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
