Skip to content

Commit

Permalink
Generate correct definition if a table shares its name with the database
Browse files Browse the repository at this point in the history
  • Loading branch information
adamors committed Apr 3, 2018
1 parent e618052 commit a6b8891
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scenic/adapters/my_sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6b8891

Please sign in to comment.