2

code cheet as follows:

Base = declarative_base()
metadata = Base.metadata
session = None

class TCmcDatum(Base):
    __tablename__ = 't_cmc_data'
    __table_args__ = (
        Index('i_cmc_data_ctime_name', 'c_time', 'slug', unique=True),
    )
    __table_args__ = {'schema':'crawler'}

    id = Column(BIGINT(20), primary_key=True, comment='autoincr id')
    c_time = Column(BIGINT(13), nullable=False, comment='created time')

of course, it can not solve the problem!

how to make it correct ? thanks

sujingqiao
  • 21
  • 2
  • 1
    Either manually update the schema through the databases UI or use a migration tool such as [alembic](https://alembic.sqlalchemy.org/en/latest/). Also see: https://stackoverflow.com/questions/7300948/add-column-to-sqlalchemy-table – SuperShoot Nov 08 '19 at 07:21

0 Answers0