# Generated by Django 5.2.5 on 2025-08-28 16:13

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


class Migration(migrations.Migration):

    dependencies = [
        ('django_scrapyd_manager', '0008_spidergroup_nodes_alter_job_spider_and_more'),
    ]

    operations = [
        migrations.AlterUniqueTogether(
            name='project',
            unique_together={('node', 'name')},
        ),
        migrations.RemoveField(
            model_name='spidergroup',
            name='nodes',
        ),
        migrations.AddField(
            model_name='spidergroup',
            name='project',
            field=models.ForeignKey(db_constraint=False, default=1, on_delete=django.db.models.deletion.CASCADE, to='django_scrapyd_manager.project', verbose_name='项目'),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='ProjectVersion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('version', models.CharField(max_length=255, verbose_name='版本')),
                ('is_spider_synced', models.BooleanField(default=False, verbose_name='是否已同步当前版本爬虫')),
                ('is_deleted', models.BooleanField(default=False, verbose_name='是否已被删除')),
                ('create_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('project', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name='spiders', to='django_scrapyd_manager.project', verbose_name='项目')),
            ],
            options={
                'verbose_name': 'Scrapy Project Version',
                'verbose_name_plural': 'Scrapy Project Version',
                'db_table': 'scrapy_project_version',
                'unique_together': {('project', 'version')},
            },
        ),
        migrations.AlterField(
            model_name='spider',
            name='project',
            field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name='spiders', to='django_scrapyd_manager.projectversion', verbose_name='版本'),
        ),
        migrations.RemoveField(
            model_name='project',
            name='is_spider_synced',
        ),
        migrations.RemoveField(
            model_name='project',
            name='version',
        ),
    ]
