from sqlalchemy import Column, Integer, String, create_engine from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Srtfile(Base): __tablename__ = 'Srtfile' id = Column(Integer, primary_key=True, autoincrement=True) videoId = Column(String(255), nullable=False) channelId = Column(String(255), nullable=False) ordinal = Column(Integer, nullable=False) srtStartTime = Column(String(255), nullable=False) srtEndTime = Column(String(255), nullable=False) # 同上 srtText = Column(String(255), nullable=False) # 如果文本可能很长,考虑增加长度 isScan = Column(Integer, nullable=True) # 允许NULL值