43 lines
2.2 KiB
Python
43 lines
2.2 KiB
Python
"""分类参数关联模型"""
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import Column, String, DateTime, Integer
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
class BasCategoryParameter(Base):
|
|
"""商品分类-参数关联表"""
|
|
__tablename__ = "bas_category_parameter"
|
|
|
|
id = Column(String(32), primary_key=True, comment="主键ID")
|
|
category_id = Column(String(32), nullable=False, comment="分类ID")
|
|
parameter_id = Column(String(32), nullable=False, comment="参数ID")
|
|
is_required = Column(Integer, default=0, comment="该分类下是否必填:0-否, 1-是")
|
|
default_value = Column(String(500), nullable=True, comment="默认值")
|
|
sort_order = Column(Integer, default=0, comment="排序")
|
|
is_del = Column(Integer, default=0, comment="是否删除:0-否, 1-是")
|
|
create_at = Column(DateTime, default=datetime.now, comment="创建时间")
|
|
create_by = Column(String(32), nullable=True, comment="创建人ID")
|
|
create_name = Column(String(100), nullable=True, comment="创建人姓名")
|
|
update_at = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment="修改时间")
|
|
update_by = Column(String(32), nullable=True, comment="修改人ID")
|
|
|
|
|
|
class BasCategoryParameterHis(Base):
|
|
"""商品分类-参数关联表历史表"""
|
|
__tablename__ = "bas_category_parameter_his"
|
|
|
|
id = Column(String(32), primary_key=True, nullable=False, comment="主键ID")
|
|
category_id = Column(String(32), nullable=True, comment="分类ID")
|
|
parameter_id = Column(String(32), nullable=True, comment="参数ID")
|
|
is_required = Column(Integer, default=0, comment="是否必填")
|
|
default_value = Column(String(500), nullable=True, comment="默认值")
|
|
sort_order = Column(Integer, default=0, comment="排序")
|
|
create_at = Column(DateTime, nullable=True, comment="创建时间")
|
|
create_by = Column(String(32), nullable=True, comment="创建人ID")
|
|
create_name = Column(String(100), nullable=True, comment="创建人姓名")
|
|
update_at = Column(DateTime, nullable=True, comment="修改时间")
|
|
update_by = Column(String(32), nullable=True, comment="修改人ID")
|
|
his_create_at = Column(DateTime, default=datetime.now, comment="历史记录创建时间")
|