# Generated by Django 3.2.3 on 2022-05-13 08:43

import django.db.models.fields
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ('api', '0005_auto_20220412_1744'),
    ]

    operations = [
        migrations.AddField(
            model_name='appstorage',
            name='max_storage_capacity',
            field=models.BigIntegerField(default=0, verbose_name='存储最大使用容量,单位btype'),
        ),
        migrations.AlterField(
            model_name='userinfo',
            name='download_times',
            field=models.PositiveBigIntegerField(default=0, verbose_name='可用下载点次数,需要用户充值'),
        ),
        migrations.AlterField(
            model_name='userinfo',
            name='storage',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL,
                                    related_name='app_storage', to='api.appstorage', verbose_name='存储'),
        ),
        migrations.AlterUniqueTogether(
            name='appstorage',
            unique_together={('user_id', 'bucket_name', 'endpoint'), ('user_id', 'name')},
        ),
        migrations.CreateModel(
            name='StorageShareInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status',
                 models.SmallIntegerField(choices=[(1, '共享成功'), (2, '取消共享')], default=0, help_text='1 共享成功 2 取消共享',
                                          verbose_name='状态')),
                ('number', models.BigIntegerField(default=0, verbose_name='容量大小，单位byte')),
                ('description', models.CharField(blank=True, default='', max_length=128, verbose_name='操作描述')),
                ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')),
                ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('storage_id', models.ForeignKey(on_delete=django.db.models.fields.CharField, to='api.appstorage',
                                                 verbose_name='存储ID')),
                ('to_user_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE,
                                                 related_name='storage_to_user_id', to=settings.AUTH_USER_MODEL,
                                                 verbose_name='用户ID')),
                ('user_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='storage_org_user_id',
                                   to=settings.AUTH_USER_MODEL, verbose_name='用户ID')),
            ],
            options={
                'verbose_name': '私有存储共享',
                'verbose_name_plural': '私有存储共享',
            },
        ),
        migrations.CreateModel(
            name='StorageExchange',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('download_times', models.BigIntegerField(default=0, verbose_name='消耗下载次数')),
                ('storage_size', models.BigIntegerField(default=0, verbose_name='兑换空间大小')),
                ('expires_time', models.DateTimeField(verbose_name='失效时间')),
                ('description', models.CharField(blank=True, default='', max_length=128, verbose_name='操作描述')),
                ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')),
                ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL,
                                              verbose_name='用户ID')),
            ],
            options={
                'verbose_name': '存储空间兑换信息',
                'verbose_name_plural': '存储空间兑换信息',
            },
        ),
    ]
