# Generated by Django 2.2.9 on 2020-06-02 10:11

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BaseConfigCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='类别名称')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('content_types', models.ManyToManyField(blank=True, help_text='使用模型反查时需要填写', to='contenttypes.ContentType', verbose_name='模型类型')),
            ],
            options={
                'verbose_name': '基础类别',
                'verbose_name_plural': '基础类别',
                'ordering': ['create_time'],
            },
        ),
        migrations.CreateModel(
            name='BaseConfigItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='配置项名称')),
                ('item_type', models.CharField(choices=[('str', '字符串'), ('bool', '布尔值'), ('int', '整数'), ('float', '浮点数'), ('decimal', '精确浮点数')], default='str', max_length=20, verbose_name='配置项类型')),
                ('str_max_length', models.PositiveSmallIntegerField(blank=True, default=127, null=True, verbose_name='字符串值长度')),
                ('max_digits', models.PositiveSmallIntegerField(blank=True, default=5, null=True, verbose_name='精确浮点数总位数')),
                ('decimal_places', models.PositiveSmallIntegerField(blank=True, default=2, null=True, verbose_name='精确浮点数小数位数')),
                ('allow_null', models.BooleanField(default=True, verbose_name='允许为空')),
                ('unit', models.CharField(blank=True, max_length=10, null=True, verbose_name='数值单位')),
                ('str_default', models.TextField(blank=True, help_text='字符串默认值', null=True, verbose_name='字符串默认值')),
                ('int_default', models.IntegerField(blank=True, help_text='整数默认值', null=True, verbose_name='整数默认值')),
                ('float_default', models.FloatField(blank=True, help_text='浮点数默认值', null=True, verbose_name='浮点数默认值')),
                ('decimal_default', models.DecimalField(blank=True, decimal_places=5, help_text='精确浮点数默认值', max_digits=20, null=True, verbose_name='精确浮点数默认值')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='baseconfig.BaseConfigCategory', verbose_name='基础类别')),
            ],
            options={
                'verbose_name': '基础配置项定义',
                'verbose_name_plural': '基础配置项定义',
                'ordering': ['category', 'pk'],
            },
        ),
        migrations.CreateModel(
            name='BaseConfigValue',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('str_value', models.TextField(blank=True, null=True, verbose_name='字符串值')),
                ('bool_value', models.BooleanField(blank=True, null=True, verbose_name='布尔值')),
                ('int_value', models.IntegerField(blank=True, null=True, verbose_name='整数值')),
                ('float_value', models.FloatField(blank=True, null=True, verbose_name='浮点数值')),
                ('decimal_value', models.DecimalField(blank=True, decimal_places=5, max_digits=30, null=True, verbose_name='精确浮点数值')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='baseconfig.BaseConfigItem', verbose_name='基础类别')),
            ],
            options={
                'verbose_name': '基础配置项值',
                'verbose_name_plural': '基础配置项值',
                'ordering': ['item', '-create_time'],
            },
        ),
    ]
