From 08ea7aa9a108a5f6abfe3340eeb47af7d963820d Mon Sep 17 00:00:00 2001 From: roger_mac Date: Tue, 9 Jan 2024 21:54:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rename_version_release_release_and_more.py | 47 +++++++++++++++++++ update/models.py | 9 ++-- 2 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 update/migrations/0015_rename_version_release_release_and_more.py diff --git a/update/migrations/0015_rename_version_release_release_and_more.py b/update/migrations/0015_rename_version_release_release_and_more.py new file mode 100644 index 0000000..af963c8 --- /dev/null +++ b/update/migrations/0015_rename_version_release_release_and_more.py @@ -0,0 +1,47 @@ +# Generated by Django 4.2.7 on 2024-01-09 13:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('update', '0014_updatecommand_run_num_updatecommand_ver'), + ] + + operations = [ + migrations.RenameField( + model_name='release', + old_name='version', + new_name='release', + ), + migrations.RenameField( + model_name='release', + old_name='short_ver', + new_name='short_release', + ), + migrations.RemoveField( + model_name='updatecommand', + name='ver', + ), + migrations.AddField( + model_name='clientrelease', + name='ver_id', + field=models.IntegerField(default=0, help_text='版本id', verbose_name='版本id'), + ), + migrations.AddField( + model_name='release', + name='main_ver', + field=models.CharField(default='', help_text='主版本号', max_length=100, verbose_name='主版本号'), + ), + migrations.AddField( + model_name='release', + name='ver_id', + field=models.IntegerField(default=0, help_text='版本id', verbose_name='版本id'), + ), + migrations.AddField( + model_name='updatecommand', + name='ver_id', + field=models.IntegerField(default=0, help_text='支持此命令的版本id', verbose_name='支持此命令的版本id'), + ), + ] diff --git a/update/models.py b/update/models.py index c17b2bb..0ec3445 100644 --- a/update/models.py +++ b/update/models.py @@ -49,8 +49,10 @@ class Release(BaseModels): 鼎新版本表 """ id = models.AutoField(primary_key=True) - version = models.CharField(verbose_name='鼎新版本', max_length=100, null=False, help_text='鼎新版本') - short_ver = models.CharField(verbose_name='短版本号', max_length=100, null=False, help_text='短版本号') + release = models.CharField(verbose_name='鼎新版本', max_length=100, null=False, help_text='鼎新版本') + short_release = models.CharField(verbose_name='短版本号', max_length=100, null=False, help_text='短版本号') + main_ver = models.CharField(verbose_name='主版本号', max_length=100, null=False, default='', help_text='主版本号') + ver_id = models.IntegerField(verbose_name='版本id', null=False, default=0, help_text='版本id') status = models.CharField(verbose_name='版本状态', max_length=10, null=False, help_text='版本状态, 0-无效,1-开发,2-测试,3-上线', default='0') @@ -73,6 +75,7 @@ class ClientRelease(BaseModels): help_text='客户端版本') main_ver = models.CharField(verbose_name='主版本', max_length=100, null=False, default='', help_text='主版本') sub_ver = models.CharField(verbose_name='小版本', max_length=10, null=False, default='', help_text='小版本') + ver_id = models.IntegerField(verbose_name='版本id', null=False, default=0, help_text='版本id') upload_name = models.CharField(verbose_name='上传名称', max_length=200, null=False, help_text='上传名称') client_type = models.CharField(verbose_name='类型', max_length=10, default='test', help_text='类型 test 测试 prd 线上') @@ -94,7 +97,7 @@ class UpdateCommand(BaseModels): id = models.AutoField(primary_key=True) desc = models.CharField(verbose_name='命令作用描述', max_length=200, null=False, help_text='命令作用描述') command = models.CharField(verbose_name='需执行的命令', max_length=2000, null=False, help_text='需执行的命令') - ver = models.CharField(verbose_name='支持此命令的版本', max_length=2000, null=False, default='', help_text='支持此命令的版本') + ver_id = models.IntegerField(verbose_name='支持此命令的版本id', null=False, default=0, help_text='支持此命令的版本id') process = models.CharField(verbose_name='执行顺序', max_length=20, default='setup', help_text='执行顺序 setup 对比数据库前执行 teardown 对比数据库后执行') run_num = models.IntegerField(verbose_name='执行命令的顺', null=False, default=0, help_text='执行命令的顺')