You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When schema.rb is created, the SQL view is inserted in alpha order. This means that if there is a later table in the schema.rb file which the view depends on, rake db:reset will fail as the dependent object is not created when the create_view is called.
The workaround is to manually edit the schema.rb file after any migrations are run, and move the views down.
Any suggestions on how to automate this? It could be further complicated if views depend on views, but if all the views we added to schema.rb after all the tables, it would solve 90% of the problems.
The text was updated successfully, but these errors were encountered:
If that's what's happening, there's a bug somewhere -- the schema_plus dumper does a topological sort to respect dependencies such as this; alphabetical order is secondary to the dependencies. Could you give a specific failing example?
This is a great gem, I use it all the time.
When schema.rb is created, the SQL view is inserted in alpha order. This means that if there is a later table in the schema.rb file which the view depends on, rake db:reset will fail as the dependent object is not created when the create_view is called.
The workaround is to manually edit the schema.rb file after any migrations are run, and move the views down.
Any suggestions on how to automate this? It could be further complicated if views depend on views, but if all the views we added to schema.rb after all the tables, it would solve 90% of the problems.
The text was updated successfully, but these errors were encountered: