From: Don Armstrong Date: Sat, 23 Aug 2014 23:56:01 +0000 (-0700) Subject: draw schema X-Git-Url: https://git.donarmstrong.com/?p=debbugs-presentations.git;a=commitdiff_plain;h=e7246990d62102e8948285335ce131a6d70cb5d1 draw schema --- diff --git a/debconf14/figures/.gitignore b/debconf14/figures/.gitignore index 2e4cdbc..014ef70 100644 --- a/debconf14/figures/.gitignore +++ b/debconf14/figures/.gitignore @@ -1,2 +1,3 @@ openlogo-crop.pdf bug_global_layout.pdf +schema.png diff --git a/debconf14/figures/Makefile b/debconf14/figures/Makefile index 8856cfb..4a04919 100644 --- a/debconf14/figures/Makefile +++ b/debconf14/figures/Makefile @@ -12,3 +12,6 @@ all: openlogo-crop.pdf bug_global_layout.pdf %.png: %.svg inkscape -e $@ -d 300 $< + +schema.png: draw_schema.pl + perl -I ~/projects/debbugs/debbugs $< $@ diff --git a/debconf14/figures/draw_schema.pl b/debconf14/figures/draw_schema.pl new file mode 100644 index 0000000..301e36a --- /dev/null +++ b/debconf14/figures/draw_schema.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use SQL::Translator; +use Debbugs::DB; + +my $s = Debbugs::DB->connect('dbi:Pg:service=debbugs'); + +my $trans = SQL::Translator->new( + parser => 'SQL::Translator::Parser::DBIx::Class', + parser_args => { dbic_schema => $s }, + producer => 'Diagram', + producer_args => { + out_file => $ARGV[0], + show_constraints => 1, + show_datatypes => 1, + show_sizes => 1, + show_fk_only => 0, + } ); +$trans->translate();