X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FParser%2FDBIx%2FClass.pm;h=3a5d918ba881eae8c2b5938221e26cb011aaa0bb;hb=c9304c0522f5cc186066acd3fba3437f3734f33c;hp=ad5998d70fd2a9c16e9d0696027df93a228beeee;hpb=02a8d9459a20417d7d0af17acc908a34328fbba7;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index ad5998d..3a5d918 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -270,6 +270,7 @@ sub parse { my $dependencies = { map { $_ => _resolve_deps ($_, \%tables) } (keys %tables) }; + for my $table (sort { keys %{$dependencies->{$a} || {} } <=> keys %{ $dependencies->{$b} || {} } @@ -298,9 +299,20 @@ EOW } my %views; - foreach my $moniker (sort keys %view_monikers) + + my @view_sources = + sort { + keys %{ $a->deploy_depends_on || {} } + <=> + keys %{ $b->deploy_depends_on || {} } + || + $a->source_name cmp $b->source_name + } + map { $dbicschema->source($_) } + keys %view_monikers; + + foreach my $source (@view_sources) { - my $source = $dbicschema->source($moniker); my $view_name = $source->name; # FIXME - this isn't the right way to do it, but sqlt does not @@ -442,9 +454,15 @@ Limit the amount of parsed sources by supplying an explicit list of source names L, L -=head1 AUTHORS +=head1 AUTHOR + +Jess Robinson + +=head2 CONTRIBUTORS -See L. +Matt Trout +Ash Berlin +Amiri Barksdale =head1 LICENSE