X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bin%2Fdebbugs-installsql;h=892aef4b10107eeebab39b0e192440f7fa9dada9;hb=5785a4bf6029d30f134046c9c154ea20c386cdaa;hp=601c1761c682885b6a95224152507c58d3f4ac92;hpb=467b91651260d474555c27f060c3e03182c9521a;p=debbugs.git diff --git a/bin/debbugs-installsql b/bin/debbugs-installsql index 601c176..892aef4 100755 --- a/bin/debbugs-installsql +++ b/bin/debbugs-installsql @@ -69,6 +69,7 @@ debbugs-installsql use vars qw($DEBUG); use Debbugs::DB; +use Debbugs::DB::Util qw(prepare_execute); use aliased 'DBIx::Class::DeploymentHandler' => 'DH'; my %options = (debug => 0, @@ -127,7 +128,8 @@ my $schema = Debbugs::DB->connect('dbi:Pg:service='.$options{service}) or my $dh = DH->new({schema => $schema, force_overwrite => $options{overwrite_deployment}, script_directory => $options{deployment_dir}, - databases => 'PostgreSQL' + databases => 'PostgreSQL', + sql_translator_args => {producer_args=> {postgres_version => 9}}, }); if ($options{current_version}) { @@ -136,6 +138,20 @@ if ($options{current_version}) { } elsif ($options{install}) { $dh->prepare_install if $options{developer_prepare}; $dh->install unless $options{developer_prepare}; + ## this is lame, but because the current release of DeploymentHandler does + ## not support WHERE or quoted indexes properly (fixed in git), we create + ## these indexes manually here. + $schema->storage-> + dbh_do(sub{my ($s,$dbh) = @_; + prepare_execute($dbh,<prepare_deploy if $options{developer_prepare}; $dh->prepare_upgrade() if $options{developer_prepare};