# Generated by Django 4.2.17 on 2024-12-07 14:11

import baykeshop.contrib.system.validators
import django.contrib.sites.managers
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BaykeDictModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, editable=False, verbose_name='是否删除')),
                ('name', models.CharField(max_length=50, verbose_name='名称')),
                ('key', models.SlugField(verbose_name='键')),
                ('value', models.TextField(help_text='\n            布尔值：true/false; \n            键值对：key1:value1一行一对;\n            list:value1,value2一行一个值;\n            json:{"key1":"value1"}\n        ', validators=[baykeshop.contrib.system.validators.validate_dict_value], verbose_name='值')),
                ('site', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='sites.site', verbose_name='站点')),
            ],
            options={
                'verbose_name': '字典管理',
                'verbose_name_plural': '字典管理',
                'ordering': ['-created_time'],
            },
            managers=[
                ('objects', django.db.models.manager.Manager()),
                ('current_site', django.contrib.sites.managers.CurrentSiteManager()),
            ],
        ),
        migrations.CreateModel(
            name='BaykeBanners',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, editable=False, verbose_name='是否删除')),
                ('title', models.CharField(max_length=50, verbose_name='标题')),
                ('image', models.ImageField(upload_to='banners', verbose_name='图片')),
                ('url', models.CharField(blank=True, default='', max_length=255, verbose_name='链接')),
                ('order', models.IntegerField(default=0, verbose_name='排序')),
                ('is_show', models.BooleanField(default=True, verbose_name='是否显示')),
                ('site', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='sites.site', verbose_name='站点')),
            ],
            options={
                'verbose_name': '轮播图',
                'verbose_name_plural': '轮播图',
                'ordering': ('-order',),
            },
            managers=[
                ('objects', django.db.models.manager.Manager()),
                ('current_site', django.contrib.sites.managers.CurrentSiteManager()),
            ],
        ),
        migrations.CreateModel(
            name='Visit',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, editable=False, verbose_name='是否删除')),
                ('object_id', models.PositiveBigIntegerField(verbose_name='对象ID')),
                ('ip', models.GenericIPAddressField(default='127.0.0.1', verbose_name='IP')),
                ('pv', models.PositiveBigIntegerField(verbose_name='PV')),
                ('uv', models.PositiveBigIntegerField(verbose_name='UV')),
                ('date', models.DateField(verbose_name='日期')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype', verbose_name='内容类型')),
                ('site', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='sites.site', verbose_name='站点')),
            ],
            options={
                'verbose_name': '分析数据',
                'verbose_name_plural': '分析数据',
                'ordering': ['-date'],
                'indexes': [models.Index(fields=['date'], name='system_visi_date_8fe15a_idx'), models.Index(fields=['content_type', 'object_id'], name='system_visi_content_0cf1e0_idx'), models.Index(fields=['content_type', 'object_id', 'date'], name='system_visi_content_8e96af_idx')],
            },
            managers=[
                ('objects', django.db.models.manager.Manager()),
                ('current_site', django.contrib.sites.managers.CurrentSiteManager()),
            ],
        ),
        migrations.AddConstraint(
            model_name='baykedictmodel',
            constraint=models.UniqueConstraint(fields=('key', 'site'), name='unique_key_site'),
        ),
    ]
