2

I create my table use next code:

class tableName(self._dbHelper.DeclarativeBase):
                __tablename__ = "tableName"
                if not tableEngine is None:
                    __table_args__ = {'mysql_engine' : tableEngine}
                first = Column(Integer, primary_key = True, autoincrement = True)
                second = Column(String(45))
                third = Column(String(100))

                def __init__(self, second = Utils.uniqID(), third = Utils.uniqID()):
                    self.second = second
                    self.third = third

But then I'm trying to drop table, I got an error that tableName not contains method drop() How can I drop this table?

4

1 回答 1

10

接下来是解决方案:

tableName.__table__.drop(self._engine)

更多细节在这里:声明性文档

于 2013-08-01T15:43:05.640 回答