Skip to content

Instantly share code, notes, and snippets.

@bokutin
Created July 10, 2013 13:35
Show Gist options
  • Save bokutin/5966324 to your computer and use it in GitHub Desktop.
Save bokutin/5966324 to your computer and use it in GitHub Desktop.
これならsqitchで、schemaもfixtureも管理できそうだ。。。かなり理想的な気がする。
use Modern::Perl;
use App::Sqitch;
use Graph::Easy;
sub run {
my $sqitch = App::Sqitch->new;
my $plan = $sqitch->plan;
my @changes = $plan->changes;
my $graph = Graph::Easy->new;
#for my $change (@changes) {
# $graph->add_node( name => $change->name );
#}
for my $change (@changes) {
my @depends = $change->requires;
for my $depend (@depends) {
$graph->add_edge( $change->name, $depend->change );
}
}
say $graph->as_ascii;
}
run(@ARGV);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment