1
0
forked from erp-dev/erp
Files
erpnew/api_v1/migrations/0018_appversion.py

40 lines
2.1 KiB
Python

import api_v1.models
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_v1', '0017_mdyplateorderstagingqiniuimageuploadstate'),
]
operations = [
migrations.CreateModel(
name='AppVersion',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
('major', models.PositiveIntegerField(default=0, verbose_name='主版本号')),
('minor', models.PositiveIntegerField(default=0, verbose_name='次版本号')),
('build', models.PositiveIntegerField(default=0, verbose_name='构建号')),
('package_file', models.FileField(blank=True, help_text='可通过 Admin 上传,保存后会自动写入下载地址', max_length=500, null=True, upload_to=api_v1.models.app_version_file_path, verbose_name='安装包文件')),
('download_url', models.URLField(blank=True, max_length=2048, verbose_name='下载地址')),
('force', models.BooleanField(default=False, verbose_name='是否强制更新')),
('publish_date', models.DateField(default=django.utils.timezone.localdate, verbose_name='发布日期')),
('message', models.TextField(blank=True, verbose_name='更新说明')),
('is_current', models.BooleanField(db_index=True, default=False, verbose_name='当前版本')),
],
options={
'verbose_name': 'App版本',
'verbose_name_plural': 'App版本',
'ordering': ['-is_current', '-created_at'],
},
),
migrations.AddConstraint(
model_name='appversion',
constraint=models.UniqueConstraint(condition=models.Q(('is_current', True)), fields=('is_current',), name='uniq_current_app_version'),
),
]