We have some mysql Views in our development and test databases that were created via an execute(sql) statement in a migration. Rails' default schema.rb creates these views as tables. When config.active_record.schema_format is set to :sql, these views are not created at all.
Is there a setting to ensure these views are re-created in the test db?
If not, can anyone suggest a workaround?
NB, the show create table
for this view is something like:
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `sales_reports` AS select ...
and the view is included in show tables
After investigation, it looks like activerecord does this intentionally.
active_record/connection_adapters/mysql_adapter.rb
Is there a good reason for this?