123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380 |
- # -*- coding: utf-8 -*-
- from sqlalchemy import String, Column, Integer,DateTime,Text,BigInteger,Boolean,PrimaryKeyConstraint,Index,UniqueConstraint,CHAR,LargeBinary,TIMESTAMP
- from sqlalchemy.dialects.mysql import TINYINT
- from sqlalchemy.sql import func
- from database import Base
- from datetime import datetime
- '''社会化关系表'''
- class SysSocial(Base):
- __tablename__ = 'sys_social'
- id = Column(BigInteger, primary_key=True,autoincrement=True, comment='主键')
- user_id = Column(BigInteger, nullable=False, comment='用户ID')
- tenant_id = Column(String(20), default=None, comment='租户id')
- auth_id = Column(String(255), nullable=False, comment='平台+平台唯一id')
- source = Column(String(255), nullable=False, comment='用户来源')
- open_id = Column(String(255), default=None, comment='平台编号唯一id')
- user_name = Column(String(30), nullable=False, comment='登录账号')
- nick_name = Column(String(30), default='', comment='用户昵称')
- email = Column(String(255), default='', comment='用户邮箱')
- avatar = Column(String(500), default='', comment='头像地址')
- access_token = Column(String(255), nullable=False, comment='用户的授权令牌')
- expire_in = Column(Integer, default=None, comment='用户的授权令牌的有效期')
- refresh_token = Column(String(255), default=None, comment='刷新令牌')
- access_code = Column(String(255), default=None, comment='平台的授权信息')
- union_id = Column(String(255), default=None, comment='用户的 unionid')
- scope = Column(String(255), default=None, comment='授予的权限')
- token_type = Column(String(255), default=None, comment='个别平台的授权信息')
- id_token = Column(String(2000), default=None, comment='id token')
- mac_algorithm = Column(String(255), default=None, comment='小米平台用户的附带属性')
- mac_key = Column(String(255), default=None, comment='小米平台用户的附带属性')
- code = Column(String(255), default=None, comment='用户的授权code')
- oauth_token = Column(String(255), default=None, comment='Twitter平台用户的附带属性')
- oauth_token_secret = Column(String(255), default=None, comment='Twitter平台用户的附带属性')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- class Config:
- orm_mode = True
- '''租户表'''
- class SysTenant(Base):
- __tablename__ = 'sys_tenant'
- id = Column(BigInteger, primary_key=True,autoincrement=True, comment='id')
- tenant_id = Column(String(20), nullable=False, comment='租户编号')
- contact_user_name = Column(String(20), comment='联系人')
- contact_phone = Column(String(20), comment='联系电话')
- company_name = Column(String(50), comment='企业名称')
- license_number = Column(String(30), comment='统一社会信用代码')
- address = Column(String(200), comment='地址')
- intro = Column(String(200), comment='企业简介')
- domain = Column(String(200), comment='域名')
- remark = Column(String(200), comment='备注')
- package_id = Column(BigInteger, comment='租户套餐编号')
- expire_time = Column(DateTime, comment='过期时间')
- account_count = Column(Integer, default=-1, comment='用户数量(-1不限制)')
- status = Column(String(1), default='0', comment='租户状态(0正常 1停用)')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- class Config:
- orm_mode = True
- '''租户套餐表'''
- class SysTenantPackage(Base):
- __tablename__ = 'sys_tenant_package'
- package_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='租户套餐id')
- package_name = Column(String(20), comment='套餐名称')
- menu_ids = Column(String(3000), comment='关联菜单id')
- remark = Column(String(200), comment='备注')
- menu_check_strictly = Column(Integer, default=1, comment='菜单树选择项是否关联显示')
- status = Column(String(1), default='0', comment='状态(0正常 1停用)')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- class Config:
- orm_mode = True
- '''部门表'''
- class SysDept(Base):
- __tablename__ = 'sys_dept'
- dept_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='部门id')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- parent_id = Column(BigInteger, default=0, comment='父部门id')
- parent_name = Column(String(30), default='', comment='父部门名称')
- ancestors = Column(String(500), default='', comment='祖级列表')
- dept_name = Column(String(30), default='', comment='部门名称')
- dept_category = Column(String(100), default=None, comment='部门类别编码')
- order_num = Column(Integer, default=0, comment='显示顺序')
- leader = Column(BigInteger, default=None, comment='负责人')
- leader_name = Column(String(30), default=None, comment='负责人姓名')
- phone = Column(String(11), default=None, comment='联系电话')
- email = Column(String(50), default=None, comment='邮箱')
- status = Column(String(1), default='0', comment='部门状态(0正常 1停用)')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- class Config:
- orm_mode = True
- '''用户信息表'''
- class SysUser(Base):
- __tablename__ = 'sys_user'
- user_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='用户ID')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- dept_id = Column(BigInteger, default=None, comment='部门ID')
- dept_name = Column(String(30), default='', comment='部门名称')
- user_name = Column(String(30), nullable=False, comment='用户账号')
- nick_name = Column(String(30), nullable=False, comment='用户昵称')
- user_type = Column(String(10), default='sys_user', comment='用户类型(sys_user系统用户)')
- email = Column(String(50), default='', comment='用户邮箱')
- phonenumber = Column(String(11), default='', comment='手机号码')
- sex = Column(String(1), default='0', comment='用户性别(0男 1女 2未知)')
- avatar = Column(BigInteger, comment='头像地址')
- password = Column(String(100), default='', comment='密码')
- status = Column(String(1), default='0', comment='帐号状态(0正常 1停用)')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- login_ip = Column(String(128), default='', comment='最后登录IP')
- login_date = Column(DateTime, comment='最后登录时间')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- yzy_account = Column(String(50), default=None, comment='粤政易账号')
- class Config:
- orm_mode = True
- '''岗位信息表'''
- class SysPost(Base):
- __tablename__ = 'sys_post'
- post_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='岗位ID')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- dept_id = Column(BigInteger, nullable=False, comment='部门id')
- post_code = Column(String(64), nullable=False, comment='岗位编码')
- post_category = Column(String(100), default=None, comment='岗位类别编码')
- post_name = Column(String(50), nullable=False, comment='岗位名称')
- post_sort = Column(Integer, nullable=False, comment='显示顺序')
- status = Column(String(1), nullable=False, comment='状态(0正常 1停用)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- class Config:
- orm_mode = True
- '''角色信息表'''
- class SysRole(Base):
- __tablename__ = 'sys_role'
- role_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='角色ID')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- role_name = Column(String(30), nullable=False, comment='角色名称')
- role_key = Column(String(100), nullable=False, comment='角色权限字符串')
- role_sort = Column(Integer, nullable=False, comment='显示顺序')
- data_scope = Column(String(1), default='1', comment='数据范围')
- menu_check_strictly = Column(Boolean, default=True, comment='菜单树选择项是否关联显示')
- dept_check_strictly = Column(Boolean, default=True, comment='部门树选择项是否关联显示')
- status = Column(String(1), nullable=False, comment='角色状态(0正常 1停用)')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- class Config:
- orm_mode = True
- '''菜单权限表'''
- class SysMenu(Base):
- __tablename__ = 'sys_menu'
- menu_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='菜单ID')
- menu_name = Column(String(50), nullable=False, comment='菜单名称')
- parent_id = Column(BigInteger, default=0, comment='父菜单ID')
- order_num = Column(Integer, default=0, comment='显示顺序')
- path = Column(String(200), default='', comment='路由地址')
- component = Column(String(255), default=None, comment='组件路径')
- query_param = Column(String(255), default=None, comment='路由参数')
- is_frame = Column(Integer, default=1, comment='是否为外链(0是 1否)')
- is_cache = Column(Integer, default=0, comment='是否缓存(0缓存 1不缓存)')
- menu_type = Column(String(1), default='', comment='菜单类型(M目录 C菜单 F按钮)')
- visible = Column(String(1), default='0', comment='显示状态(0显示 1隐藏)')
- status = Column(String(1), default='0', comment='菜单状态(0正常 1停用)')
- perms = Column(String(100), default=None, comment='权限标识')
- icon = Column(String(100), default='#', comment='菜单图标')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default='', comment='备注')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- class Config:
- orm_mode = True
- '''用户和角色关联表'''
- class SysUserRole(Base):
- __tablename__ = 'sys_user_role'
- __table_args__ = (PrimaryKeyConstraint('role_id', 'user_id'),)
- user_id = Column(BigInteger, nullable=True, comment='用户ID')
- role_id = Column(BigInteger, nullable=True, comment='角色ID')
- class Config:
- orm_mode = True
- '''用户和视频关联表'''
- class SysUserVideo(Base):
- __tablename__ = 'sys_user_video'
- __table_args__ = (PrimaryKeyConstraint('video_code_int', 'user_id'),)
- user_id = Column(BigInteger, nullable=True, comment='用户ID')
- video_code_int = Column(String(255), nullable=True, comment='视频ID')
- class Config:
- orm_mode = True
- '''角色和菜单关联表'''
- class SysRoleMenu(Base):
- __tablename__ = 'sys_role_menu'
- __table_args__ = (PrimaryKeyConstraint('role_id', 'menu_id'),)
- role_id = Column(BigInteger, nullable=False, comment='角色ID')
- menu_id = Column(BigInteger, nullable=False, comment='菜单ID')
- class Config:
- orm_mode = True
- '''角色和部门关联表'''
- class SysRoleDept(Base):
- __tablename__ = 'sys_role_dept'
- __table_args__ = (PrimaryKeyConstraint('role_id', 'dept_id'),)
- role_id = Column(BigInteger, nullable=False, comment='角色ID')
- dept_id = Column(BigInteger, nullable=False, comment='部门ID')
- class Config:
- orm_mode = True
- '''用户与岗位关联表'''
- class SysUserPost(Base):
- __tablename__ = 'sys_user_post'
- __table_args__ = (PrimaryKeyConstraint('user_id', 'post_id'),)
- user_id = Column(BigInteger, nullable=False, comment='用户ID')
- post_id = Column(BigInteger, nullable=False, comment='岗位ID')
- class Config:
- orm_mode = True
- '''菜单权限表'''
- class SysMenuLayer(Base):
- __tablename__ = 'sys_menu_layer'
- menu_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='菜单ID')
- menu_name = Column(String(50), nullable=False, comment='菜单名称')
- parent_id = Column(BigInteger, default=0, comment='父菜单ID')
- order_num = Column(Integer, default=0, comment='显示顺序')
- path = Column(String(200), default='', comment='路由地址')
- component = Column(String(255), default=None, comment='组件路径')
- query_param = Column(String(255), default=None, comment='路由参数')
- is_frame = Column(Integer, default=1, comment='是否为外链(0是 1否)')
- is_cache = Column(Integer, default=0, comment='是否缓存(0缓存 1不缓存)')
- menu_type = Column(String(1), default='', comment='菜单类型(M目录 C菜单 F按钮)')
- visible = Column(String(1), default='0', comment='显示状态(0显示 1隐藏)')
- status = Column(String(1), default='0', comment='菜单状态(0正常 1停用)')
- perms = Column(String(100), default=None, comment='权限标识')
- icon = Column(String(100), default='#', comment='菜单图标')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default='', comment='备注')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- class Config:
- orm_mode = True
- '''操作日志记录'''
- class SysOperLog(Base):
- __tablename__ = 'sys_oper_log'
- __table_args__ = (
- Index('idx_sys_oper_log_bt', 'business_type'),
- Index('idx_sys_oper_log_s', 'status'),
- Index('idx_sys_oper_log_ot', 'oper_time'),
- )
- oper_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='日志主键')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- title = Column(String(50), default='', comment='模块标题')
- business_type = Column(Integer, default=0, comment='业务类型(0其它 1新增 2修改 3删除)')
- method = Column(String(100), default='', comment='方法名称')
- request_method = Column(String(10), default='', comment='请求方式')
- operator_type = Column(Integer, default=0, comment='操作类别(0其它 1后台用户 2手机端用户)')
- oper_name = Column(String(50), default='', comment='操作人员')
- dept_name = Column(String(50), default='', comment='部门名称')
- oper_url = Column(String(255), default='', comment='请求URL')
- oper_ip = Column(String(128), default='', comment='主机地址')
- oper_location = Column(String(255), default='', comment='操作地点')
- oper_param = Column(Text, default='', comment='请求参数')
- json_result = Column(Text, default='', comment='返回参数')
- status = Column(Integer, default=0, comment='操作状态(0正常 1异常)')
- error_msg = Column(String(2000), default='', comment='错误消息')
- oper_time = Column(DateTime, comment='操作时间')
- cost_time = Column(BigInteger, default=0, comment='消耗时间')
- class Config:
- orm_mode = True
- '''字典类型表'''
- class SysDictType(Base):
- __tablename__ = 'sys_dict_type'
- dict_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='字典主键')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- dict_name = Column(String(100), default='', comment='字典名称')
- dict_type = Column(String(100), default='', comment='字典类型')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- # 定义唯一性约束条件
- __table_args__ = (UniqueConstraint('tenant_id', 'dict_type', name='uq_sys_dict_type_tenant_type'),)
- class Config:
- orm_mode = True
- '''字典数据表'''
- class SysDictData(Base):
- __tablename__ = 'sys_dict_data'
- dict_code = Column(BigInteger, primary_key=True,autoincrement=True, comment='字典编码')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- dict_sort = Column(Integer, default=0, comment='字典排序')
- dict_label = Column(String(100), default='', comment='字典标签')
- dict_value = Column(String(100), default='', comment='字典键值')
- dict_type = Column(String(100), default='', comment='字典类型')
- css_class = Column(String(100), default=None, comment='样式属性(其他样式扩展)')
- list_class = Column(String(100), default=None, comment='表格回显样式')
- is_default = Column(CHAR(1), default='N', comment='是否默认(Y是 N否)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- class Config:
- orm_mode = True
- '''参数配置表'''
- class SysConfig(Base):
- __tablename__ = 'sys_config'
- config_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='参数主键')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- config_name = Column(String(100), default='', comment='参数名称')
- config_key = Column(String(100), default='', comment='参数键名')
- config_value = Column(String(500), default='', comment='参数键值')
- config_type = Column(CHAR(1), default='N', comment='系统内置(Y是 N否)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- class Config:
- orm_mode = True
- '''系统访问记录'''
- class SysLoginInfor(Base):
- __tablename__ = 'sys_logininfor'
- info_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='访问ID')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- user_name = Column(String(50), default='', comment='用户账号')
- client_key = Column(String(32), default='', comment='客户端')
- device_type = Column(String(32), default='', comment='设备类型')
- ipaddr = Column(String(128), default='', comment='登录IP地址')
- login_location = Column(String(255), default='', comment='登录地点')
- browser = Column(String(50), default='', comment='浏览器类型')
- os = Column(String(50), default='', comment='操作系统')
- status = Column(CHAR(1), default='0', comment='登录状态(0成功 1失败)')
- msg = Column(String(255), default='', comment='提示消息')
- login_time = Column(DateTime, comment='访问时间')
- # 定义表的索引(可选,根据需要添加到Base中)
- __table_args__ = (
- # 假设Base已经包含了索引的创建方式
- Index('idx_sys_logininfor_s', 'status'),
- Index('idx_sys_logininfor_lt', 'login_time'),
- )
- class Config:
- orm_mode = True
- '''通知公告表'''
- class SysNotice(Base):
- __tablename__ = 'sys_notice'
- notice_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='公告ID')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- notice_title = Column(String(50), nullable=False, comment='公告标题')
- notice_type = Column(CHAR(1), nullable=False, comment='公告类型(1通知 2公告)')
- notice_content = Column(LargeBinary, default=None, comment='公告内容')
- status = Column(CHAR(1), default='0', comment='公告状态(0正常 1关闭)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(255), default=None, comment='备注')
- class Config:
- orm_mode = True
- '''代码生成业务表'''
- class GenTable(Base):
- __tablename__ = 'gen_table'
- table_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='编号')
- data_name = Column(String(200), default='', comment='数据源名称')
- table_name = Column(String(200), default='', comment='表名称')
- table_comment = Column(String(500), default='', comment='表描述')
- sub_table_name = Column(String(64), default=None, comment='关联子表的表名')
- sub_table_fk_name = Column(String(64), default=None, comment='子表关联的外键名')
- class_name = Column(String(100), default='', comment='实体类名称')
- tpl_category = Column(String(200), default='crud', comment='使用的模板(crud单表操作 tree树表操作)')
- package_name = Column(String(100), comment='生成包路径')
- module_name = Column(String(30), comment='生成模块名')
- business_name = Column(String(30), comment='生成业务名')
- function_name = Column(String(50), comment='生成功能名')
- function_author = Column(String(50), comment='生成功能作者')
- gen_type = Column(CHAR(1), default='0', comment='生成代码方式(0zip压缩包 1自定义路径)')
- gen_path = Column(String(200), default='/', comment='生成路径(不填默认项目路径)')
- options = Column(String(1000), comment='其它生成选项')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- class Config:
- orm_mode = True
- '''代码生成业务表字段'''
- class GenTableColumn(Base):
- __tablename__ = 'gen_table_column'
- column_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='编号')
- table_id = Column(BigInteger, comment='归属表编号')
- column_name = Column(String(200), comment='列名称')
- column_comment = Column(String(500), comment='列描述')
- column_type = Column(String(100), comment='列类型')
- java_type = Column(String(500), comment='JAVA类型')
- java_field = Column(String(200), comment='JAVA字段名')
- is_pk = Column(CHAR(1), comment='是否主键(1是)')
- is_increment = Column(CHAR(1), comment='是否自增(1是)')
- is_required = Column(CHAR(1), comment='是否必填(1是)')
- is_insert = Column(CHAR(1), comment='是否为插入字段(1是)')
- is_edit = Column(CHAR(1), comment='是否编辑字段(1是)')
- is_list = Column(CHAR(1), comment='是否列表字段(1是)')
- is_query = Column(CHAR(1), comment='是否查询字段(1是)')
- query_type = Column(String(200), default='EQ', comment='查询方式(等于、不等于、大于、小于、范围)')
- html_type = Column(String(200), comment='显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)')
- dict_type = Column(String(200), default='', comment='字典类型')
- sort = Column(Integer, comment='排序')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- class Config:
- orm_mode = True
- '''OSS对象存储表'''
- class SysOss(Base):
- __tablename__ = 'sys_oss'
- oss_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='对象存储主键')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- file_name = Column(String(255), default='', nullable=False, comment='文件名')
- original_name = Column(String(255), default='', nullable=False, comment='原名')
- file_suffix = Column(String(10), default='', nullable=False, comment='文件后缀名')
- url = Column(String(500), nullable=False, comment='URL地址')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- service = Column(String(20), default='minio', nullable=False, comment='服务商')
- class Config:
- orm_mode = True
- '''对象存储配置表'''
- class SysOssConfig(Base):
- __tablename__ = 'sys_oss_config'
- oss_config_id = Column(BigInteger, primary_key=True,autoincrement=True, comment='主键')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- config_key = Column(String(20), default='', nullable=False, comment='配置key')
- access_key = Column(String(255), default='', comment='accessKey')
- secret_key = Column(String(255), default='', comment='秘钥')
- bucket_name = Column(String(255), default='', comment='桶名称')
- prefix = Column(String(255), default='', comment='前缀')
- endpoint = Column(String(255), default='', comment='访问站点')
- domain = Column(String(255), default='', comment='自定义域名')
- is_https = Column(CHAR(1), default='N', comment='是否https(Y=是,N=否)')
- region = Column(String(255), default='', comment='域')
- access_policy = Column(CHAR(1), nullable=False, default='1', comment='桶权限类型(0=private 1=public 2=custom)')
- status = Column(CHAR(1), default='1', comment='是否默认(0=是,1=否)')
- ext1 = Column(String(255), default='', comment='扩展字段')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default=None, comment='备注')
- class Config:
- orm_mode = True
- '''系统授权表'''
- class SysClient(Base):
- __tablename__ = 'sys_client'
- id = Column(BigInteger, primary_key=True,autoincrement=True, comment='id')
- client_id = Column(String(64), default=None, comment='客户端id')
- client_key = Column(String(32), default=None, comment='客户端key')
- client_secret = Column(String(255), default=None, comment='客户端秘钥')
- grant_type = Column(String(255), default=None, comment='授权类型')
- device_type = Column(String(32), default=None, comment='设备类型')
- active_timeout = Column(Integer, default=1800, comment='token活跃超时时间')
- timeout = Column(Integer, default=604800, comment='token固定超时')
- status = Column(CHAR(1), default='0', comment='状态(0正常 1停用)')
- del_flag = Column(CHAR(1), default='0', comment='删除标志(0代表存在 2代表删除)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- class Config:
- orm_mode = True
- '''测试单表'''
- class TestDemo(Base):
- __tablename__ = 'test_demo'
- id = Column(BigInteger, primary_key=True,autoincrement=True, comment='主键')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- dept_id = Column(BigInteger, default=None, comment='部门id')
- user_id = Column(BigInteger, default=None, comment='用户id')
- order_num = Column(Integer, default=0, comment='排序号')
- test_key = Column(String(255), default=None, comment='key键')
- value = Column(String(255), default=None, comment='值')
- version = Column(Integer, default=0, comment='版本')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- del_flag = Column(Integer, default=0, comment='删除标志')
- class Config:
- orm_mode = True
- '''测试树表'''
- class TestTree(Base):
- __tablename__ = 'test_tree'
- id = Column(BigInteger, primary_key=True,autoincrement=True, comment='主键')
- tenant_id = Column(String(20), default='000000', comment='租户编号')
- parent_id = Column(BigInteger, default=0, comment='父id')
- dept_id = Column(BigInteger, default=None, comment='部门id')
- user_id = Column(BigInteger, default=None, comment='用户id')
- tree_name = Column(String(255), default=None, comment='树节点名称')
- version = Column(Integer, default=0, comment='版本')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- del_flag = Column(Integer, default=0, comment='删除标志')
- class Config:
- orm_mode = True
- '''flowable'''
- '''请假申请表'''
- class TestLeave(Base):
- __tablename__ = 'test_leave'
- id = Column(BigInteger, primary_key=True, comment='主键')
- leave_type = Column(String(255), nullable=False, comment='请假类型')
- start_date = Column(DateTime, nullable=False, comment='开始时间')
- end_date = Column(DateTime, nullable=False, comment='结束时间')
- leave_days = Column(Integer, nullable=False, comment='请假天数')
- remark = Column(String(255), comment='请假原因')
- status = Column(String(255), comment='状态')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- tenant_id = Column(String(20), comment='租户编号')
- class Config:
- orm_mode = True
- '''流程分类'''
- class WfCategory(Base):
- __tablename__ = 'wf_category'
- id = Column(BigInteger, primary_key=True, comment='主键')
- category_name = Column(String(255), comment='分类名称')
- category_code = Column(String(255), comment='分类编码')
- parent_id = Column(BigInteger, comment='父级id')
- sort_num = Column(Integer, comment='排序')
- tenant_id = Column(String(20), comment='租户编号')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- # 定义唯一性约束条件
- __table_args__ = (UniqueConstraint('category_code', name='uni_category_code'),)
- class Config:
- orm_mode = True
- '''节点审批记录'''
- class WfTaskBackNode(Base):
- __tablename__ = 'wf_task_back_node'
- id = Column(BigInteger, primary_key=True, comment='主键')
- node_id = Column(String(255), nullable=False, comment='节点id')
- node_name = Column(String(255), nullable=False, comment='节点名称')
- order_no = Column(Integer, nullable=False, comment='排序')
- instance_id = Column(String(255), comment='流程实例id')
- task_type = Column(String(255), nullable=False, comment='节点类型')
- assignee = Column(String(2000), nullable=False, comment='审批人')
- tenant_id = Column(String(20), comment='租户编号')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- class Config:
- orm_mode = True
- '''流程定义配置'''
- class WfDefinitionConfig(Base):
- __tablename__ = 'wf_definition_config'
- id = Column(BigInteger, primary_key=True, comment='主键')
- table_name = Column(String(255), nullable=False, comment='表名')
- definition_id = Column(String(255), nullable=False, comment='流程定义ID')
- process_key = Column(String(255), nullable=False, comment='流程KEY')
- version = Column(Integer, nullable=False, comment='流程版本')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- remark = Column(String(500), default='', comment='备注')
- tenant_id = Column(String(20), comment='租户编号')
- # 定义唯一性约束条件
- __table_args__ = (UniqueConstraint('definition_id', name='uni_definition_id'),)
- class Config:
- orm_mode = True
- '''表单管理'''
- class WfFormManage(Base):
- __tablename__ = 'wf_form_manage'
- id = Column(BigInteger, primary_key=True, comment='主键')
- form_name = Column(String(255), nullable=False, comment='表单名称')
- form_type = Column(String(255), nullable=False, comment='表单类型')
- router = Column(String(255), nullable=False, comment='路由地址/表单ID')
- remark = Column(String(500), comment='备注')
- tenant_id = Column(String(20), comment='租户编号')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- class Config:
- orm_mode = True
- '''节点配置'''
- class WfNodeConfig(Base):
- __tablename__ = 'wf_node_config'
- id = Column(BigInteger, primary_key=True, comment='主键')
- form_id = Column(BigInteger, comment='表单id')
- form_type = Column(String(255), comment='表单类型')
- node_name = Column(String(255), nullable=False, comment='节点名称')
- node_id = Column(String(255), nullable=False, comment='节点id')
- definition_id = Column(String(255), nullable=False, comment='流程定义id')
- apply_user_task = Column(CHAR(1), default='0', comment='是否为申请人节点(0是 1否)')
- create_dept = Column(BigInteger, default=None, comment='创建部门')
- create_by = Column(BigInteger, default=None, comment='创建者')
- create_time = Column(DateTime, default=datetime.now, comment='创建时间')
- update_by = Column(BigInteger, default=None, comment='更新者')
- update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- tenant_id = Column(String(20), comment='租户编号')
- class Config:
- orm_mode = True
- '''snail_job'''
- '''命名空间'''
- class SjNamespace(Base):
- __tablename__ = 'sj_namespace'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- name = Column(String(64), nullable=False, comment='名称')
- unique_id = Column(String(64), nullable=False, comment='唯一id')
- description = Column(String(256), nullable=False, default='', comment='描述')
- deleted = Column(TINYINT(4), nullable=False, default=0, comment='逻辑删除 1、删除')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_name', 'name'),
- UniqueConstraint('unique_id', name='uk_unique_id'),
- )
- class Config:
- orm_mode = True
- '''组配置'''
- class SjGroupConfig(Base):
- __tablename__ = 'sj_group_config'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, default='', comment='组名称')
- description = Column(String(256), nullable=False, default='', comment='组描述')
- token = Column(String(64), nullable=False, default='SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', comment='token')
- group_status = Column(TINYINT(4), nullable=False, default=0, comment='组状态 0、未启用 1、启用')
- version = Column(Integer, nullable=False, comment='版本号')
- group_partition = Column(Integer, nullable=False, comment='分区')
- id_generator_mode = Column(TINYINT(4), nullable=False, default=1, comment='唯一id生成模式 默认号段模式')
- init_scene = Column(TINYINT(4), nullable=False, default=0, comment='是否初始化场景 0:否 1:是')
- bucket_index = Column(Integer, nullable=False, default=0, comment='bucket')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义唯一性约束条件
- __table_args__ = (UniqueConstraint('namespace_id', 'group_name', name='uk_namespace_id_group_name'),)
- class Config:
- orm_mode = True
- '''通知配置'''
- class SjNotifyConfig(Base):
- __tablename__ = 'sj_notify_config'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- business_id = Column(String(64), nullable=False, comment='业务id (job_id或workflow_id或scene_name)')
- system_task_type = Column(TINYINT(4), nullable=False, default=3, comment='任务类型')
- notify_status = Column(TINYINT(4), nullable=False, default=0, comment='通知状态')
- recipient_ids = Column(String(128), nullable=False, comment='接收人id列表')
- notify_threshold = Column(Integer, nullable=False, default=0, comment='通知阈值')
- notify_scene = Column(TINYINT(4), nullable=False, default=0, comment='通知场景')
- rate_limiter_status = Column(TINYINT(4), nullable=False, default=0, comment='限流状态')
- rate_limiter_threshold = Column(Integer, nullable=False, default=0, comment='每秒限流阈值')
- description = Column(String(256), nullable=False, default='', comment='描述')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_namespace_id_group_name_scene_name', 'namespace_id', 'group_name', 'business_id'),)
- class Config:
- orm_mode = True
- '''告警通知接收人'''
- class SjNotifyRecipient(Base):
- __tablename__ = 'sj_notify_recipient'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- recipient_name = Column(String(64), nullable=False, comment='接收人名称')
- notify_type = Column(TINYINT(4), nullable=False, default=0, comment='通知类型')
- notify_attribute = Column(String(512), nullable=False, comment='配置属性')
- description = Column(String(256), nullable=False, default='', comment='描述')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_namespace_id', 'namespace_id'),
- )
- class Config:
- orm_mode = True
- '''死信队列表'''
- class SjRetryDeadLetter(Base):
- __tablename__ = 'sj_retry_dead_letter_0'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- unique_id = Column(String(64), nullable=False, comment='同组下id唯一')
- group_name = Column(String(64), nullable=False, comment='组名称')
- scene_name = Column(String(64), nullable=False, comment='场景名称')
- idempotent_id = Column(String(64), nullable=False, comment='幂等id')
- biz_no = Column(String(64), nullable=False, default='', comment='业务编号')
- executor_name = Column(String(512), nullable=False, default='', comment='执行器名称')
- args_str = Column(Text, nullable=False, comment='执行方法参数')
- ext_attrs = Column(Text, nullable=False, comment='扩展字段')
- task_type = Column(TINYINT(4), nullable=False, default=1, comment='任务类型')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- # 定义索引和唯一性约束条件
- __table_args__ = (
- Index('idx_namespace_id_group_name_scene_name', 'namespace_id', 'group_name', 'scene_name'),
- Index('idx_idempotent_id', 'idempotent_id'),
- Index('idx_biz_no', 'biz_no'),
- Index('idx_create_dt', 'create_dt'),
- UniqueConstraint('namespace_id', 'group_name', 'unique_id', name='uk_namespace_id_group_name_unique_id'),
- )
- class Config:
- orm_mode = True
- '''任务表'''
- class SjRetryTask(Base):
- __tablename__ = 'sj_retry_task_0'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- unique_id = Column(String(64), nullable=False, comment='同组下id唯一')
- group_name = Column(String(64), nullable=False, comment='组名称')
- scene_name = Column(String(64), nullable=False, comment='场景名称')
- idempotent_id = Column(String(64), nullable=False, comment='幂等id')
- biz_no = Column(String(64), nullable=False, default='', comment='业务编号')
- executor_name = Column(String(512), nullable=False, default='', comment='执行器名称')
- args_str = Column(Text, nullable=False, comment='执行方法参数')
- ext_attrs = Column(Text, nullable=False, comment='扩展字段')
- next_trigger_at = Column(DateTime, nullable=False, comment='下次触发时间')
- retry_count = Column(Integer, nullable=False, default=0, comment='重试次数')
- retry_status = Column(TINYINT(4), nullable=False, default=0, comment='重试状态')
- task_type = Column(TINYINT(4), nullable=False, default=1, comment='任务类型')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引和唯一性约束条件
- __table_args__ = (
- Index('idx_namespace_id_group_name_scene_name', 'namespace_id', 'group_name', 'scene_name'),
- Index('idx_namespace_id_group_name_task_type', 'namespace_id', 'group_name', 'task_type'),
- Index('idx_namespace_id_group_name_retry_status', 'namespace_id', 'group_name', 'retry_status'),
- Index('idx_idempotent_id', 'idempotent_id'),
- Index('idx_biz_no', 'biz_no'),
- Index('idx_create_dt', 'create_dt'),
- UniqueConstraint('namespace_id', 'group_name', 'unique_id', name='uk_name_unique_id'),
- )
- class Config:
- orm_mode = True
- '''任务日志基础信息表'''
- class SjRetryTaskLog(Base):
- __tablename__ = 'sj_retry_task_log'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- unique_id = Column(String(64), nullable=False, comment='同组下id唯一')
- group_name = Column(String(64), nullable=False, comment='组名称')
- scene_name = Column(String(64), nullable=False, comment='场景名称')
- idempotent_id = Column(String(64), nullable=False, comment='幂等id')
- biz_no = Column(String(64), nullable=False, default='', comment='业务编号')
- executor_name = Column(String(512), nullable=False, default='', comment='执行器名称')
- args_str = Column(Text, nullable=False, comment='执行方法参数')
- ext_attrs = Column(Text, nullable=False, comment='扩展字段')
- retry_status = Column(TINYINT(4), nullable=False, default=0, comment='重试状态')
- task_type = Column(TINYINT(4), nullable=False, default=1, comment='任务类型')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_group_name_scene_name', 'namespace_id', 'group_name', 'scene_name'),
- Index('idx_retry_status', 'retry_status'),
- Index('idx_idempotent_id', 'idempotent_id'),
- Index('idx_unique_id', 'unique_id'),
- Index('idx_biz_no', 'biz_no'),
- Index('idx_create_dt', 'create_dt'),
- )
- class Config:
- orm_mode = True
- '''任务调度日志信息记录表'''
- class SjRetryTaskLogMessage(Base):
- __tablename__ = 'sj_retry_task_log_message'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- unique_id = Column(String(64), nullable=False, comment='同组下id唯一')
- message = Column(Text, nullable=False, comment='异常信息')
- log_num = Column(Integer, nullable=False, default=1, comment='日志数量')
- real_time = Column(BigInteger, nullable=False, default=0, comment='上报时间')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- # 定义索引
- __table_args__ = (
- Index('idx_namespace_id_group_name_unique_id', 'namespace_id', 'group_name', 'unique_id'),
- Index('idx_create_dt', 'create_dt'),
- )
- class Config:
- orm_mode = True
- '''场景配置'''
- class SjRetrySceneConfig(Base):
- __tablename__ = 'sj_retry_scene_config'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- scene_name = Column(String(64), nullable=False, comment='场景名称')
- group_name = Column(String(64), nullable=False, comment='组名称')
- scene_status = Column(TINYINT(4), nullable=False, default=0, comment='组状态')
- max_retry_count = Column(Integer, nullable=False, default=5, comment='最大重试次数')
- back_off = Column(TINYINT(4), nullable=False, default=1, comment='重试间隔类型')
- trigger_interval = Column(String(16), nullable=False, default='', comment='间隔时长')
- deadline_request = Column(BigInteger, nullable=False, default=60000, comment='Deadline Request 调用链超时 单位毫秒')
- executor_timeout = Column(Integer, nullable=False, default=5, comment='任务执行超时时间,单位秒')
- route_key = Column(TINYINT(4), nullable=False, default=4, comment='路由策略')
- description = Column(String(256), nullable=False, default='', comment='描述')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义唯一性约束条件
- __table_args__ = (
- UniqueConstraint('namespace_id', 'group_name', 'scene_name', name='uk_namespace_id_group_name_scene_name'),
- )
- class Config:
- orm_mode = True
- '''服务器节点'''
- class SjServerNode(Base):
- __tablename__ = 'sj_server_node'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- host_id = Column(String(64), nullable=False, comment='主机id')
- host_ip = Column(String(64), nullable=False, comment='机器ip')
- host_port = Column(Integer, nullable=False, comment='机器端口')
- expire_at = Column(DateTime, nullable=False, comment='过期时间')
- node_type = Column(TINYINT(4), nullable=False, comment='节点类型')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引和唯一性约束条件
- __table_args__ = (
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- Index('idx_expire_at_node_type', 'expire_at', 'node_type'),
- UniqueConstraint('host_id', 'host_ip', name='uk_host_id_host_ip'),
- )
- class Config:
- orm_mode = True
- '''锁定表'''
- class SjDistributedLock(Base):
- __tablename__ = 'sj_distributed_lock'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- name = Column(String(64), nullable=False, comment='锁名称')
- lock_until = Column(TIMESTAMP(3), nullable=False, default=datetime.now, onupdate=datetime.now, comment='锁定时长')
- locked_at = Column(TIMESTAMP(3), nullable=False, default=datetime.now, comment='锁定时间')
- locked_by = Column(String(255), nullable=False, comment='锁定者')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, comment='修改时间')
- # 定义唯一性约束条件
- __table_args__ = (
- UniqueConstraint('name', name='uk_name'),
- )
- class Config:
- orm_mode = True
- '''系统用户表'''
- class SjSystemUser(Base):
- __tablename__ = 'sj_system_user'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- username = Column(String(64), nullable=False, unique=True, comment='账号') # 唯一约束在 SQLAlchemy 中用 unique=True 表示
- password = Column(String(128), nullable=False, comment='密码')
- role = Column(TINYINT(4), nullable=False, default=0, comment='角色')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- class Config:
- orm_mode = True
- '''系统用户权限表'''
- class SjSystemUserPermission(Base):
- __tablename__ = 'sj_system_user_permission'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- group_name = Column(String(64), nullable=False, comment='组名称')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- system_user_id = Column(BigInteger, nullable=False, comment='系统用户id')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义唯一性约束条件
- __table_args__ = (
- UniqueConstraint('namespace_id', 'group_name', 'system_user_id', name='uk_namespace_id_group_name_system_user_id'),
- )
- class Config:
- orm_mode = True
- '''号段模式序号ID分配表'''
- class SjSequenceAlloc(Base):
- __tablename__ = 'sj_sequence_alloc'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, default='', comment='组名称')
- max_id = Column(BigInteger, nullable=False, default=1, comment='最大id')
- step = Column(Integer, nullable=False, default=100, comment='步长')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
- # 定义唯一性约束条件
- __table_args__ = (
- UniqueConstraint('namespace_id', 'group_name', name='uk_namespace_id_group_name'),
- )
- class Config:
- orm_mode = True
- '''任务信息'''
- class SjJob(Base):
- __tablename__ = 'sj_job'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- job_name = Column(String(64), nullable=False, comment='名称')
- args_str = Column(Text, default=None, comment='执行方法参数')
- args_type = Column(TINYINT(4), nullable=False, default=1, comment='参数类型')
- next_trigger_at = Column(BigInteger, nullable=False, comment='下次触发时间')
- job_status = Column(TINYINT(4), nullable=False, default=1, comment='任务状态')
- task_type = Column(TINYINT(4), nullable=False, default=1, comment='任务类型')
- route_key = Column(TINYINT(4), nullable=False, default=4, comment='路由策略')
- executor_type = Column(TINYINT(4), nullable=False, default=1, comment='执行器类型')
- executor_info = Column(String(255), default=None, comment='执行器名称')
- trigger_type = Column(TINYINT(4), nullable=False, comment='触发类型')
- trigger_interval = Column(String(255), nullable=False, comment='间隔时长')
- block_strategy = Column(TINYINT(4), nullable=False, default=1, comment='阻塞策略')
- executor_timeout = Column(Integer, nullable=False, default=0, comment='任务执行超时时间')
- max_retry_times = Column(Integer, nullable=False, default=0, comment='最大重试次数')
- parallel_num = Column(Integer, nullable=False, default=1, comment='并行数')
- retry_interval = Column(Integer, nullable=False, default=0, comment='重试间隔(s)')
- bucket_index = Column(Integer, nullable=False, default=0, comment='bucket')
- resident = Column(TINYINT(4), nullable=False, default=0, comment='是否是常驻任务')
- description = Column(String(256), nullable=False, default='', comment='描述')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- deleted = Column(TINYINT(4), nullable=False, default=0, comment='逻辑删除')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- Index('idx_job_status_bucket_index', 'job_status', 'bucket_index'),
- Index('idx_create_dt', 'create_dt'),
- )
- class Config:
- orm_mode = True
- '''调度日志'''
- class SjJobLogMessage(Base):
- __tablename__ = 'sj_job_log_message'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- job_id = Column(BigInteger, nullable=False, comment='任务信息id')
- task_batch_id = Column(BigInteger, nullable=False, comment='任务批次id')
- task_id = Column(BigInteger, nullable=False, comment='调度任务id')
- message = Column(Text, nullable=False, comment='调度信息')
- log_num = Column(Integer, nullable=False, default=1, comment='日志数量')
- real_time = Column(BigInteger, nullable=False, default=0, comment='上报时间')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- # 定义索引
- __table_args__ = (
- Index('idx_task_batch_id_task_id', 'task_batch_id', 'task_id'),
- Index('idx_create_dt', 'create_dt'),
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- )
- class Config:
- orm_mode = True
- '''任务实例'''
- class SjJobTask(Base):
- __tablename__ = 'sj_job_task'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- job_id = Column(BigInteger, nullable=False, comment='任务信息id')
- task_batch_id = Column(BigInteger, nullable=False, comment='调度任务id')
- parent_id = Column(BigInteger, nullable=False, default=0, comment='父执行器id')
- task_status = Column(TINYINT(4), nullable=False, default=0, comment='执行的状态')
- retry_count = Column(Integer, nullable=False, default=0, comment='重试次数')
- client_info = Column(String(128), default=None, comment='客户端地址')
- result_message = Column(Text, nullable=False, comment='执行结果')
- args_str = Column(Text, default=None, comment='执行方法参数')
- args_type = Column(TINYINT(4), nullable=False, default=1, comment='参数类型')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_task_batch_id_task_status', 'task_batch_id', 'task_status'),
- Index('idx_create_dt', 'create_dt'),
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- )
- class Config:
- orm_mode = True
- '''任务批次'''
- class SjJobTaskBatch(Base):
- __tablename__ = 'sj_job_task_batch'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- job_id = Column(BigInteger, nullable=False, comment='任务id')
- workflow_node_id = Column(BigInteger, nullable=False, default=0, comment='工作流节点id')
- parent_workflow_node_id = Column(BigInteger, nullable=False, default=0, comment='工作流任务父批次id')
- workflow_task_batch_id = Column(BigInteger, nullable=False, default=0, comment='工作流任务批次id')
- task_batch_status = Column(TINYINT(4), nullable=False, default=0, comment='任务批次状态')
- operation_reason = Column(TINYINT(4), nullable=False, default=0, comment='操作原因')
- execution_at = Column(BigInteger, nullable=False, default=0, comment='任务执行时间')
- system_task_type = Column(TINYINT(4), nullable=False, default=3, comment='任务类型')
- parent_id = Column(String(64), nullable=False, default='', comment='父节点')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- deleted = Column(TINYINT(4), nullable=False, default=0, comment='逻辑删除')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_job_id_task_batch_status', 'job_id', 'task_batch_status'),
- Index('idx_create_dt', 'create_dt'),
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- Index('idx_workflow_task_batch_id_workflow_node_id', 'workflow_task_batch_id', 'workflow_node_id'),
- )
- class Config:
- orm_mode = True
- '''DashBoard_Job'''
- class SjJobSummary(Base):
- __tablename__ = 'sj_job_summary'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, default='', comment='组名称')
- business_id = Column(BigInteger, nullable=False, comment='业务id')
- system_task_type = Column(TINYINT(4), nullable=False, default=3, comment='任务类型')
- trigger_at = Column(DateTime, nullable=False, default=datetime.now, comment='统计时间')
- success_num = Column(Integer, nullable=False, default=0, comment='执行成功-日志数量')
- fail_num = Column(Integer, nullable=False, default=0, comment='执行失败-日志数量')
- fail_reason = Column(String(512), nullable=False, default='', comment='失败原因')
- stop_num = Column(Integer, nullable=False, default=0, comment='执行停止-日志数量')
- stop_reason = Column(String(512), nullable=False, default='', comment='停止原因')
- cancel_num = Column(Integer, nullable=False, default=0, comment='执行取消-日志数量')
- cancel_reason = Column(String(512), nullable=False, default='', comment='取消原因')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引和唯一性约束条件
- __table_args__ = (
- Index('idx_namespace_id_group_name_business_id', 'namespace_id', 'group_name', 'business_id'),
- UniqueConstraint('trigger_at', 'system_task_type', 'business_id', name='uk_trigger_at_system_task_type_business_id'),
- )
- class Config:
- orm_mode = True
- '''DashBoard_Retry'''
- class SjRetrySummary(Base):
- __tablename__ = 'sj_retry_summary'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, default='', comment='组名称')
- scene_name = Column(String(50), nullable=False, default='', comment='场景名称')
- trigger_at = Column(DateTime, nullable=False, default=datetime.now, comment='统计时间')
- running_num = Column(Integer, nullable=False, default=0, comment='重试中-日志数量')
- finish_num = Column(Integer, nullable=False, default=0, comment='重试完成-日志数量')
- max_count_num = Column(Integer, nullable=False, default=0, comment='重试到达最大次数-日志数量')
- suspend_num = Column(Integer, nullable=False, default=0, comment='暂停重试-日志数量')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, onupdate=datetime.now, comment='修改时间')
- # 定义索引和唯一性约束条件
- __table_args__ = (
- Index('idx_trigger_at', 'trigger_at'),
- UniqueConstraint('namespace_id', 'group_name', 'scene_name', 'trigger_at', name='uk_scene_name_trigger_at'),
- )
- class Config:
- orm_mode = True
- '''工作流'''
- class SjWorkflow(Base):
- __tablename__ = 'sj_workflow'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- workflow_name = Column(String(64), nullable=False, comment='工作流名称')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- workflow_status = Column(TINYINT(4), nullable=False, default=1, comment='工作流状态')
- trigger_type = Column(TINYINT(4), nullable=False, comment='触发类型')
- trigger_interval = Column(String(255), nullable=False, comment='间隔时长')
- next_trigger_at = Column(BigInteger, nullable=False, comment='下次触发时间')
- block_strategy = Column(TINYINT(4), nullable=False, default=1, comment='阻塞策略')
- executor_timeout = Column(Integer, nullable=False, default=0, comment='任务执行超时时间')
- description = Column(String(256), nullable=False, default='', comment='描述')
- flow_info = Column(Text, default=None, comment='流程信息')
- bucket_index = Column(Integer, nullable=False, default=0, comment='bucket')
- version = Column(Integer, nullable=False, comment='版本号')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- deleted = Column(TINYINT(4), nullable=False, default=0, comment='逻辑删除')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_create_dt', 'create_dt'),
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- )
- class Config:
- orm_mode = True
- '''工作流节点'''
- class SjWorkflowNode(Base):
- __tablename__ = 'sj_workflow_node'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- node_name = Column(String(64), nullable=False, comment='节点名称')
- group_name = Column(String(64), nullable=False, comment='组名称')
- job_id = Column(BigInteger, nullable=False, comment='任务信息id')
- workflow_id = Column(BigInteger, nullable=False, comment='工作流ID')
- node_type = Column(TINYINT(4), nullable=False, default=1, comment='节点类型')
- expression_type = Column(TINYINT(4), nullable=False, default=0, comment='表达式类型')
- fail_strategy = Column(TINYINT(4), nullable=False, default=1, comment='失败策略')
- workflow_node_status = Column(TINYINT(4), nullable=False, default=1, comment='工作流节点状态')
- priority_level = Column(Integer, nullable=False, default=1, comment='优先级')
- node_info = Column(Text, default=None, comment='节点信息')
- version = Column(Integer, nullable=False, comment='版本号')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- deleted = Column(TINYINT(4), nullable=False, default=0, comment='逻辑删除')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_create_dt', 'create_dt'),
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- )
- class Config:
- orm_mode = True
- '''工作流批次'''
- class SjWorkflowTaskBatch(Base):
- __tablename__ = 'sj_workflow_task_batch'
- id = Column(BigInteger, primary_key=True, autoincrement=True, comment='主键')
- namespace_id = Column(String(64), nullable=False, default='764d604ec6fc45f68cd92514c40e9e1a', comment='命名空间id')
- group_name = Column(String(64), nullable=False, comment='组名称')
- workflow_id = Column(BigInteger, nullable=False, comment='工作流任务id')
- task_batch_status = Column(TINYINT(4), nullable=False, default=0, comment='任务批次状态')
- operation_reason = Column(TINYINT(4), nullable=False, default=0, comment='操作原因')
- flow_info = Column(Text, default=None, comment='流程信息')
- execution_at = Column(BigInteger, nullable=False, default=0, comment='任务执行时间')
- ext_attrs = Column(String(256), nullable=True, default='', comment='扩展字段')
- deleted = Column(TINYINT(4), nullable=False, default=0, comment='逻辑删除')
- create_dt = Column(DateTime, nullable=False, default=datetime.now, comment='创建时间')
- update_dt = Column(DateTime, nullable=False, onupdate=datetime.now, comment='修改时间')
- # 定义索引
- __table_args__ = (
- Index('idx_workflow_id_task_batch_status', 'workflow_id', 'task_batch_status'),
- Index('idx_create_dt', 'create_dt'),
- Index('idx_namespace_id_group_name', 'namespace_id', 'group_name'),
- )
- class Config:
- orm_mode = True
|