Skip to content

Views should follow tables in schema.rb #14

@scarroll32

Description

@scarroll32

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions