[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Start of perl setup and drop db scripts



On Mon, Mar 26, 2012 at 11:13 AM, Chris Bennett
<..hidden..> wrote:
> OK, these are very rough starts.
> I am only doing command line stuff so far.
> I am still looking at adding admin user through
> save_user.
> Right now just doing it manually.
> I found a couple of problems.
>
>
> DBD::Pg::db pg_putcopyend failed: ERROR:  duplicate key value violates
> unique constraint "language_pkey"
> DETAIL:  Key (code)=(pl) already exists.
> CONTEXT:  COPY language, line 1: "pl|Polish" at dirt.pl line 207.
> Not getting all languages into language table
>
> Fixed with :
> my $cmd="SELECT code FROM language;";
> my @languages;
> undef my $vetor;
> my $sth = $dbh->prepare($cmd);
>        $sth->execute;
>        while ($vetor = $sth->fetchrow) {
>                push @languages, $vetor;
>                }
>                $sth->finish;
>
> ######################################################
>
> no tsearch2 in LedgerSMB::Database->create for 9.1+ or in
> sql/Pg-database.sql

tsearch2 is no longer needed since we require PostgreSQL 8.3 and higher.
>
>
> I added a perl script to drop company database, optionally database
> owner role and optionally admin role;
>
>
> Feel free to criticize and make suggestions.
> I have to do a lot more, obviously
>
> I can't get any of this to indent right so I will attach the two files
> and put up a copy at:
> http://64.85.161.47:8081/dirt.pl
> http://64.85.161.47:8081/mydrop_db_roles.pl

Thanks.  I will look at these shortly.  It's a little late to get them
in 1.3.14, but we can add them for 1.3.15 if they work.

Best Wishes,
Chris Travers
>
> Chris Bennett
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Ledger-smb-devel mailing list
> ..hidden..
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
>