# Generated by Django 5.2.5 on 2025-08-18 15:16

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Node',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='节点名称')),
                ('ip', models.GenericIPAddressField(verbose_name='IP地址')),
                ('port', models.IntegerField(blank=True, default=6800, null=True)),
                ('ssl', models.BooleanField(default=False, verbose_name='是否启用SSL')),
                ('description', models.CharField(blank=True, max_length=500, null=True, verbose_name='描述')),
                ('auth', models.BooleanField(default=False, verbose_name='是否需要认证')),
                ('username', models.CharField(blank=True, max_length=255, null=True)),
                ('password', models.CharField(blank=True, max_length=255, null=True)),
                ('create_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': 'Scrapyd Node',
                'verbose_name_plural': 'Scrapyd Node',
                'db_table': 'scrapyd_node',
                'ordering': ['-create_time'],
            },
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default=None, max_length=255)),
                ('version', models.CharField(default=None, max_length=255)),
                ('create_time', models.DateTimeField(verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('node', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='django_scrapyd_manager.node', verbose_name='节点')),
            ],
            options={
                'verbose_name': 'Scrapy Project',
                'verbose_name_plural': 'Scrapy Project',
                'db_table': 'scrapy_project',
                'unique_together': {('node', 'name', 'version')},
            },
        ),
        migrations.CreateModel(
            name='Spider',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default=None, max_length=255)),
                ('create_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='django_scrapyd_manager.project', verbose_name='爬虫')),
            ],
            options={
                'verbose_name': 'Scrapy Spider',
                'verbose_name_plural': 'Scrapy Spider',
                'db_table': 'scrapy_spider',
                'unique_together': {('project', 'name')},
            },
        ),
    ]
