From: Brian O'Connor Date: Sun, 25 Apr 2004 10:13:31 +0000 (+0000) Subject: Modified the Turnkey producer to correcly output URLs. This method will need to... X-Git-Tag: v0.06~63 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=79989cde68468ddfa0d28a0b205874a5d4cce405;p=dbsrgits%2FSQL-Translator.git Modified the Turnkey producer to correcly output URLs. This method will need to be updated once we start using more than the /db/ prefix. --- diff --git a/lib/SQL/Translator/Producer/Turnkey.pm b/lib/SQL/Translator/Producer/Turnkey.pm index 1398d43..5590c1c 100644 --- a/lib/SQL/Translator/Producer/Turnkey.pm +++ b/lib/SQL/Translator/Producer/Turnkey.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::Turnkey; # ------------------------------------------------------------------- -# $Id: Turnkey.pm,v 1.49 2004-04-25 00:38:40 boconnor Exp $ +# $Id: Turnkey.pm,v 1.50 2004-04-25 10:13:31 boconnor Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -22,7 +22,7 @@ package SQL::Translator::Producer::Turnkey; use strict; use vars qw[ $VERSION $DEBUG ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.49 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.50 $ =~ /(\d+)\.(\d+)/; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Schema::Constants; @@ -368,16 +368,26 @@ use base qw(Class::DBI::Pg); [% baseclass %]->set_db('Main', '[% db_dsn %]', '[% db_user %]', '[% db_pass %]'); sub search_ilike { shift->_do_search(ILIKE => [% "\@\_" %] ) } +sub search_lower { + my $c = shift; + my %q = @_; + my %t; + foreach my $k (keys %q){ + $t{"lower($k)"} = lc($q{$k}); + } + $c->_do_search(LIKE => %t); +} + # debug method sub dump { my $self = shift; - my %arg = @_; - $arg{indent} ||= 1; - $arg{depth} ||= 2; - $Data::Dumper::Maxdepth = $arg{depth} if defined $arg{depth}; - $Data::Dumper::Indent = $arg{indent} if defined $arg{indent}; - return(Dumper($arg{object})); + my %arg = %{shift @_}; + $arg{'indent'} ||= 1; + $arg{'depth'} ||= 3; + $Data::Dumper::Maxdepth = $arg{'depth'} if defined $arg{'depth'}; + $Data::Dumper::Indent = $arg{'indent'} if defined $arg{'indent'}; + return(Dumper($arg{'object'})); } [% FOREACH node = nodes %] @@ -503,6 +513,12 @@ EOF [%- END -%] [% END %] + + + + + + @@ -540,6 +556,17 @@ EOF [%- END %] [% END %] + + + + + + + + + + + @@ -552,6 +579,11 @@ EOF [%- END -%] [% END %] + + + + + @@ -620,8 +652,9 @@ EOF [% END %] [% MACRO obj2url(obj) SWITCH obj %] [% CASE DEFAULT %] - /[% ref(obj) | replace('.+::','') %]/[% obj %] + /[% ref(obj) | replace('.+::','') %]/db/[% obj %] [% END %] + [% MACRO obj2desc(obj) SWITCH ref(obj) %] [% CASE '' %] [% obj %]