How to delete a table in SQLAlchemy?

Just call drop() against the table object. From the docs: Issue a DROP statement for this Table, using the given Connectable for connectivity. In your case it should be: User.__table__.drop() If you get an exception like: sqlalchemy.exc.UnboundExecutionError: Table object ‘my_users’ is not bound to an Engine or Connection. Execution can not proceed without a database … Read more

Rails DB Migration – How To Drop a Table?

You won’t always be able to simply generate the migration to already have the code you want. You can create an empty migration and then populate it with the code you need. You can find information about how to accomplish different tasks in a migration here: http://api.rubyonrails.org/classes/ActiveRecord/Migration.html More specifically, you can see how to drop … Read more