Program/mooc/models/core.py
雨过 582063819c
提交part2的model
Signed-off-by: 雨过 <zxx1747362695@qq.com>
2025-01-05 07:22:28 +00:00

148 lines
4.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from sqlalchemy import Column, Integer, String, Text, ForeignKey
from sqlalchemy.dialects.mysql import BIGINT
from mooc.db.database import Base
# ImsCoreCache模型用于映射数据库表ims_core_cache
class ImsCoreCache(Base):
__tablename__ = "ims_core_cache"
acid = Column(String(255), primary_key=True) # 将主键key改为acid并假设合适的类型可按需调整
class Config:
orm_mode = True
# ImsCoreCron模型用于映射数据库表ims_core_cron
class ImsCoreCron(Base):
__tablename__ = "ims_core_cron"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
createtime = Column(Integer, nullable=True)
nextruntime = Column(Integer, nullable=True)
uniacid = Column(Integer, nullable=True)
cloudid = Column(Integer, nullable=True)
class Config:
orm_mode = True
# ImsCoreCronRecord模型用于映射数据库表ims_core_cron_record
class ImsCoreCronRecord(Base):
__tablename__ = "ims_core_cron_record"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
uniacid = Column(Integer, nullable=True)
tid = Column(Integer, nullable=True)
module = Column(String(255), nullable=True)
class Config:
orm_mode = True
# ImsCoreJob模型用于映射数据库表ims_core_job
class ImsCoreJob(Base):
__tablename__ = "ims_core_job"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
class Config:
orm_mode = True
# ImsCoreMenu模型用于映射数据库表ims_core_menu
class ImsCoreMenu(Base):
__tablename__ = "ims_core_menu"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
class Config:
orm_mode = True
# ImsCoreMenuShortcut模型用于映射数据库表ims_core_menu_shortcut
class ImsCoreMenuShortcut(Base):
__tablename__ = "ims_core_menu_shortcut"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
uid = Column(Integer, ForeignKey('ims_users.uid'), nullable=True) # 假设关联ims_users表的uid字段可按需调整
class Config:
orm_mode = True
# ImsCorePaylog模型用于映射数据库表ims_core_paylog
class ImsCorePaylog(Base):
__tablename__ = "ims_core_paylog"
acid = Column(BIGINT, primary_key=True) # 将主键plid改为acid假设类型为BIGINT可按需调整
openid = Column(String(255), nullable=True)
tid = Column(Integer, nullable=True)
uniacid = Column(Integer, nullable=True)
uniontid = Column(String(255), nullable=True)
class Config:
orm_mode = True
# ImsCorePerformance模型用于映射数据库表ims_core_performance
class ImsCorePerformance(Base):
__tablename__ = "ims_core_performance"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
class Config:
orm_mode = True
# ImsCoreQueue模型用于映射数据库表ims_core_queue
class ImsCoreQueue(Base):
__tablename__ = "ims_core_queue"
acid = Column(Integer, primary_key=True) # 将主键qid改为acid
uniacid = Column(Integer, nullable=True)
module = Column(String(255), nullable=True)
dateline = Column(Integer, nullable=True)
class Config:
orm_mode = True
# ImsCoreRefundlog模型用于映射数据库表ims_core_refundlog
class ImsCoreRefundlog(Base):
__tablename__ = "ims_core_refundlog"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
refund_uniontid = Column(String(255), nullable=True)
uniontid = Column(String(255), nullable=True)
class Config:
orm_mode = True
# ImsCoreResource模型用于映射数据库表ims_core_resource
class ImsCoreResource(Base):
__tablename__ = "ims_core_resource"
acid = Column(Integer, primary_key=True) # 将主键mid改为acid
uniacid = Column(Integer, nullable=True)
type = Column(String(255), nullable=True)
class Config:
orm_mode = True
# ImsCoreSendsmsLog模型用于映射数据库表ims_core_sendsms_log
class ImsCoreSendsmsLog(Base):
__tablename__ = "ims_core_sendsms_log"
acid = Column(Integer, primary_key=True) # 将主键id改为acid
class Config:
orm_mode = True
# ImsCoreSessions模型用于映射数据库表ims_core_sessions
class ImsCoreSessions(Base):
__tablename__ = "ims_core_sessions"
acid = Column(String(255), primary_key=True) # 将主键sid改为acid
class Config:
orm_mode = True
# ImsCoreSettings模型用于映射数据库表ims_core_settings
class ImsCoreSettings(Base):
__tablename__ = "ims_core_settings"
acid = Column(String(255), primary_key=True) # 将主键key改为acid
class Config:
orm_mode = True