module ActiveRecord::ModelSchema::ClassMethods

def table_exists?

Indicates whether the table associated with this class exists
def table_exists?
  connection.schema_cache.data_source_exists?(table_name)
end