So far I have used the following statements in SQLAlchemy to implement table inheritance via ALTER TABLE:
inherit = "ALTER TABLE %(fullname)s INHERIT parent_table"
DDL(inherit, on='postgresql').execute_at("after-create", child_table)
This is deprecated in SQLAlchemy now, and I am a bit confused about the new method through
DDLEvents, DDLElement.execute_if(), listeners and events in general.
What is the correct way to create and execute DDL() constructs in SQLAlchemy 0.7+?
Look at an example in documentation, your code can be rewritten as: