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
I'm not 100% sure about this as a bug in general or on my end but here's the situation:
It looks like the schema.rb "create_view" entries are populated alphabetically. This is a problem when a child model references a parent model who's view is not yet defined.
Here's my example:
I have data model for literature citations in which class EPeriodicalCitation < PeridoicalCitation
create_view"view_e_periodical_citations","select `view_periodical_citations`.`id` AS `id` (REST OF LINE REMOVED) do |v| # column definitionendcreate_view "view_periodical_citations", "select`view_authored_citations`.`id` (RESTOFLINEREMOVED)do |v|
# column definitionend
Since 'view_e_periodical_citations' is < 'view_periodical_citations' it gets output first and causes an ERROR when rake db:test:prepare is run.
The simple fix for me was to reorder the schema.rb file so that base views are referenced before child views. I don't know if a general fix based on class hierarchy is easy or difficult but I thought I'd pass along the message.
The text was updated successfully, but these errors were encountered:
This seems to be a general problem. I'm building an example app, following the docs and I'm having the same problem, when trying to do
rake db:test:prepare
It seems that views are dumped alphabetically by default. The real solution would be to follow the migration order. Any ideas how to achieve this automatically?
I'm not 100% sure about this as a bug in general or on my end but here's the situation:
It looks like the schema.rb "create_view" entries are populated alphabetically. This is a problem when a child model references a parent model who's view is not yet defined.
Here's my example:
I have data model for literature citations in which
class EPeriodicalCitation < PeridoicalCitation
Since 'view_e_periodical_citations' is < 'view_periodical_citations' it gets output first and causes an ERROR when
rake db:test:prepare
is run.The simple fix for me was to reorder the schema.rb file so that base views are referenced before child views. I don't know if a general fix based on class hierarchy is easy or difficult but I thought I'd pass along the message.
The text was updated successfully, but these errors were encountered: