diff --git a/lib/scenic/adapters/my_sql.rb b/lib/scenic/adapters/my_sql.rb index fc6cc61..9b03082 100644 --- a/lib/scenic/adapters/my_sql.rb +++ b/lib/scenic/adapters/my_sql.rb @@ -87,7 +87,7 @@ def drop_materialized_view(*_) execute("SHOW CREATE VIEW #{quote_table_name(name)}") .first[1] .sub(/\A.*#{quote_table_name(name)} AS /i, '') - .gsub(/#{quote_table_name(@connectable.connection.current_database)}\./, '') + .gsub(/(\s|\(|,)#{quote_table_name(@connectable.connection.current_database)}\./, '\1') end end end