1852dda7 by 周伟奇

db table add retry field

1 parent 9af4935a
from django.db import models
from .named_enum import DocStatus, KeywordsType
from .named_enum import DocStatus, KeywordsType, RetryStep
# Create your models here.
......@@ -31,6 +31,9 @@ class HILDoc(models.Model):
metadata_version_id = models.CharField(max_length=64, verbose_name="元数据版本id")
application_id = models.CharField(max_length=64, verbose_name="申请id") # 联合索引
status = models.SmallIntegerField(default=DocStatus.INIT.value, verbose_name="文件状态") # 联合索引
retry_step = models.SmallIntegerField(null=True, verbose_name="重试环节")
retry_times = models.SmallIntegerField(default=0, verbose_name="重试次数")
is_retry = models.BooleanField(default=False, verbose_name="是否需要重试")
main_applicant = models.CharField(max_length=16, verbose_name="主申请人")
co_applicant = models.CharField(max_length=16, verbose_name="共同申请人")
guarantor_1 = models.CharField(max_length=16, verbose_name="担保人1")
......@@ -52,6 +55,9 @@ class AFCDoc(models.Model):
metadata_version_id = models.CharField(max_length=64, verbose_name="元数据版本id")
application_id = models.CharField(max_length=64, verbose_name="申请id")
status = models.SmallIntegerField(default=DocStatus.INIT.value, verbose_name="文件状态")
retry_step = models.SmallIntegerField(null=True, verbose_name="重试环节")
retry_times = models.SmallIntegerField(default=0, verbose_name="重试次数")
is_retry = models.BooleanField(default=False, verbose_name="是否需要重试")
main_applicant = models.CharField(max_length=16, verbose_name="主申请人")
co_applicant = models.CharField(max_length=16, verbose_name="共同申请人")
guarantor_1 = models.CharField(max_length=16, verbose_name="担保人1")
......
......@@ -9,6 +9,11 @@ class DocStatus(NamedEnum):
COMPLETE = (4, '已完成')
class RetryStep(NamedEnum):
OCR = (0, 'OCR识别')
UPLOAD = (1, '同步EDMS')
class KeywordsType(NamedEnum):
INTEREST = (0, "利息")
SALARY = (1, '薪资')
......
......@@ -9,6 +9,13 @@ cursor.execute("create database hil")
cursor.close()
cnxn.close()
# retry_step = models.SmallIntegerField(null=True, verbose_name="重试环节")
# retry_times = models.SmallIntegerField(default=0, verbose_name="重试次数")
# is_retry = models.BooleanField(default=False, verbose_name="是否需要重试")
# retry_step tinyint,
# retry_times tinyint default 0 not null,
# is_retry bit default 0 not null,
hil_sql_1 = """
create table auth_group
(
......@@ -305,6 +312,9 @@ hil_sql_2 = """
metadata_version_id nvarchar(64) not null,
application_id nvarchar(64) not null,
status tinyint default 0 not null,
retry_step tinyint,
retry_times tinyint default 0 not null,
is_retry bit default 0 not null,
main_applicant nvarchar(16) not null,
co_applicant nvarchar(16) not null,
guarantor_1 nvarchar(16) not null,
......@@ -394,6 +404,9 @@ create table keywords
metadata_version_id nvarchar(64) not null,
application_id nvarchar(64) not null,
status tinyint default 0 not null,
retry_step tinyint,
retry_times tinyint default 0 not null,
is_retry bit default 0 not null,
main_applicant nvarchar(16) not null,
co_applicant nvarchar(16) not null,
guarantor_1 nvarchar(16) not null,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!