# Generated by Django 4.2.27 on 2026-01-25 20:47

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("peizhi", "0004_tupianpeizhi"),
    ]

    operations = [
        migrations.CreateModel(
            name="ShangjiaMoban",
            fields=[
                (
                    "id",
                    models.AutoField(
                        primary_key=True, serialize=False, verbose_name="模板ID"
                    ),
                ),
                (
                    "yonghu_id",
                    models.CharField(
                        db_index=True, max_length=7, verbose_name="用户ID"
                    ),
                ),
                (
                    "leixing_id",
                    models.PositiveIntegerField(
                        db_index=True, verbose_name="商品类型ID"
                    ),
                ),
                (
                    "moban_jieshao",
                    models.CharField(max_length=500, verbose_name="模板介绍"),
                ),
                (
                    "jiage",
                    models.DecimalField(
                        decimal_places=2,
                        help_text="单位：元",
                        max_digits=10,
                        verbose_name="模板价格",
                    ),
                ),
                (
                    "fabu_shuliang",
                    models.PositiveIntegerField(default=0, verbose_name="发布数量"),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "update_time",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
            ],
            options={
                "verbose_name": "商家订单模板",
                "verbose_name_plural": "商家订单模板",
                "db_table": "shangjia_moban",
                "indexes": [
                    models.Index(
                        fields=["yonghu_id", "leixing_id"],
                        name="shangjia_mo_yonghu__bb287d_idx",
                    ),
                    models.Index(
                        fields=["yonghu_id", "leixing_id", "id"],
                        name="shangjia_mo_yonghu__4240d0_idx",
                    ),
                ],
                "unique_together": {("yonghu_id", "leixing_id", "moban_jieshao")},
            },
        ),
        migrations.CreateModel(
            name="ShangjiaLianjie",
            fields=[
                (
                    "id",
                    models.AutoField(
                        primary_key=True, serialize=False, verbose_name="链接ID"
                    ),
                ),
                (
                    "yonghu_id",
                    models.CharField(
                        db_index=True, max_length=7, verbose_name="用户ID"
                    ),
                ),
                (
                    "leixing_id",
                    models.PositiveIntegerField(
                        db_index=True, verbose_name="商品类型ID"
                    ),
                ),
                (
                    "moban_id",
                    models.PositiveIntegerField(db_index=True, verbose_name="模板ID"),
                ),
                (
                    "lianjie",
                    models.CharField(
                        max_length=500, unique=True, verbose_name="链接地址"
                    ),
                ),
                (
                    "dingdan_id",
                    models.CharField(
                        blank=True,
                        db_index=True,
                        max_length=32,
                        null=True,
                        verbose_name="订单ID",
                    ),
                ),
                (
                    "is_used",
                    models.BooleanField(
                        db_index=True, default=False, verbose_name="是否已使用"
                    ),
                ),
                (
                    "shiyongzhe_ip",
                    models.CharField(
                        blank=True, max_length=50, null=True, verbose_name="使用者IP"
                    ),
                ),
                (
                    "youxiao_shijian",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="有效截止时间"
                    ),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "update_time",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
            ],
            options={
                "verbose_name": "商家链接",
                "verbose_name_plural": "商家链接",
                "db_table": "shangjia_lianjie",
                "indexes": [
                    models.Index(
                        fields=["yonghu_id", "moban_id", "leixing_id"],
                        name="shangjia_li_yonghu__9f2b25_idx",
                    ),
                    models.Index(
                        fields=["dingdan_id"], name="shangjia_li_dingdan_95b682_idx"
                    ),
                ],
            },
        ),
    ]
