# Generated by Django 3.2.10 on 2022-05-21 18:35

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


class Migration(migrations.Migration):

    dependencies = [
        ('products', '0050_auto_20220521_1447'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='codebatch',
            name='product',
        ),
        migrations.RemoveField(
            model_name='codebatch',
            name='tenant',
        ),
        migrations.AddField(
            model_name='codebatch',
            name='num_digits',
            field=models.IntegerField(default=10, verbose_name='尾号长度'),
        ),
        migrations.AddField(
            model_name='serialcode',
            name='is_active',
            field=models.BooleanField(default=False, verbose_name='已激活'),
        ),
        migrations.AddField(
            model_name='serialcode',
            name='product',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='batches', to='products.product', verbose_name='产品'),
        ),
        migrations.AddField(
            model_name='serialcode',
            name='seq_num',
            field=models.IntegerField(null=True, verbose_name='流水号'),
        ),
        migrations.AddField(
            model_name='serialcode',
            name='tenant',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='codebatches', to='products.tenant'),
        ),
        migrations.AlterUniqueTogether(
            name='serialcode',
            unique_together={('tenant', 'seq_num')},
        ),
        migrations.CreateModel(
            name='UserMessage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sender', models.TextField(null=True)),
                ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('read', models.BooleanField(default=False)),
                ('subject', models.TextField()),
                ('content', models.TextField()),
                ('content_type', models.CharField(default='text/plain', max_length=128)),
                ('receiver_admin', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='products.admininfo')),
                ('receiver_tenant', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='products.tenant')),
            ],
        ),
    ]
