EmpaticoOrg / scenic-mysql_adapter

MySQL adapter for thoughtbot/scenic
MIT License
30 stars 15 forks source link

Fix schema.rb generation for Rails 4.x #5

Closed josepegea closed 6 years ago

josepegea commented 6 years ago

In versions 4.x, when updating the schema.rb file, Rails includes any view in the DB in the list "create_table" statements.

When scenic adds the corresponding "create_view" statements, they fail because of the duplicate names.

This is due to MySQL including views in the output of "show tables" and Rails not filtering them out.

This code patches the schema dumper on old Rails versios to prevent outputting views as if they were tables.

This should fix #2

cainlevy commented 6 years ago

Looks good! Thanks @josepegea

cainlevy commented 6 years ago

available in v1.0.1