How do I best hook into the schema definition functions in ActiveRecord?

I want to hook into the schema migration functions such as create_table, add_index, etc to append suffixes to the passed names before they are sent to the database.

I’ve been reading the source of activerecord, in particular the ActiveRecord::Migration::CommandRecorder, ActiveRecord::ConnectionAdapters::*ConnectionAdapter classes, and the Postgresql::SchemaDefinitions module.

My investigation started with wrapping the @connection object in a Migration class with a proxy object, but it seems that the schema updates that are part of the block passed to create_table aren’t captured because it is handled outside the migration class context and so directly interfaces with the underlying connection adapter.

My thinking now goes that it might be easier to just create a new connection adapter that delegates to the original PostgreSQL adapter, but before I spend a lot more time investigating this, I want to know if someone here might more experience on this module and could advise me?