from django.db import models from common.base_model import BaseModels class Cinema(BaseModels): """ 影院信息表 """ id = models.AutoField(primary_key=True) name = models.CharField(verbose_name='影院名称', max_length=100, null=False, help_text='影院名称') ip = models.CharField(verbose_name='影院ip', max_length=20, null=False, help_text='影院ip') zz_num = models.CharField(verbose_name='影院转账8位编码', max_length=8, null=False, help_text='影院转账8位编码') inner_id = models.CharField(verbose_name="影院4位编码", max_length=4, null=False, help_text='影院4位编码') db_user = models.CharField(verbose_name='影院数据库账号', max_length=20, null=False, help_text='影院数据库账号') db_pwd = models.CharField(verbose_name='影院数据库密码', max_length=50, null=False, help_text='影院数据库密码') sys_ver = models.CharField(verbose_name='鼎新系统版本', max_length=50, null=False, help_text='鼎新系统版本') client_ver = models.CharField(verbose_name='鼎新客户端版本', max_length=50, null=False, help_text='鼎新客户端版本') user = models.CharField(verbose_name='使用人', max_length=10, null=True, help_text='当前使用人') def __str__(self): return self.ip class Meta: verbose_name = '影院信息' verbose_name_plural = '影院信息' db_table = 'update_cinema' class CinemaUser(models.Model): """ 鼎新使用人表 """ id = models.AutoField(primary_key=True) username = models.CharField(verbose_name='用户名', max_length=30, null=False, help_text='用户名') pinyin = models.CharField(verbose_name='用户名拼音', max_length=30, null=False, default='', help_text='用户名拼音') is_delete = models.BooleanField(verbose_name='是否删除', default=False, help_text='是否删除') def __str__(self): return self.username class Meta: verbose_name = '影院使用人' verbose_name_plural = '影院使用人' db_table = 'update_cinema_user' class Release(BaseModels): """ 鼎新版本表 """ id = models.AutoField(primary_key=True) 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') def __str__(self): return self.release class Meta: verbose_name = '鼎新版本' verbose_name_plural = '鼎新版本' db_table = 'update_dingxin_release' class ClientRelease(BaseModels): """ 鼎新客户端版本 """ id = models.AutoField(primary_key=True) origin_name = models.CharField(verbose_name='原始名称', max_length=500, null=False, help_text='smb上的名称') client_ver = models.CharField(verbose_name='客户端版本', max_length=100, null=False, default='', 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 线上') is_delete = models.BooleanField(verbose_name='是否有效', default=False, help_text='是否有效') def __str__(self): return self.upload_name class Meta: verbose_name = '鼎新客户端版本' verbose_name_plural = '鼎新客户端版本' db_table = 'update_client_release' 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_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='执行命令的顺') is_sys = models.BooleanField(verbose_name='系统命令', default=False, help_text='系统命令,默认执行前台不展示') is_checked = models.BooleanField(verbose_name='默认勾选', default=False, help_text='前台页面默认是否勾选') is_delete = models.BooleanField(verbose_name='是否有效', default=True, help_text='是否有效') def __str__(self): return self.desc class Meta: verbose_name = '升级脚本' verbose_name_plural = '升级脚本' db_table = 'update_command'