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?
The solution is next:
tableName.__table__.drop(self._engine)
More details are here: Declarative doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With