[Bio] / Clearinghouse / init_clearinghouse.pl Repository:
ViewVC logotype

View of /Clearinghouse/init_clearinghouse.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (download) (as text) (annotate) (vendor branch)
Thu Apr 7 15:55:31 2005 UTC (14 years, 6 months ago) by olson
Branch: init, MAIN
CVS Tags: myrast_33, init1, HEAD
Changes since 1.1: +0 -0 lines
Initial import of clearinghouse code.

use strict;

use DBrtns;

my $dbname = "clearinghouse";

my $db = new DBrtns(undef, $dbname) or die;

init_clearinghouse_tables($db);

sub init_clearinghouse_tables
{
    my($db) = @_;

    my $serial_type;
    if ($db->{_dbms} eq "mysql")
    {
	$serial_type = "int not null auto_increment";
    }
    elsif ($db->{_dbms} eq "Pg")
    {
	$serial_type = "serial";

	$db->SQL("SET CONSTRAINTS ALL DEFERRED");
    }

    $db->drop_table(tbl => 'registered_genome');
    $db->create_table(tbl => 'registered_genome',
		      flds => qq(id varchar(255) PRIMARY KEY,
				 name varchar(255),
				 submitted_by varchar(255),
				 md5sum char(32)
				)
		      );

    $db->drop_table(tbl => 'next_genome_index');
    $db->create_table(tbl => 'next_genome_index',
		     flds => qq(next_index int
			       )
		     );
    $db->SQL("insert into next_genome_index values(1)");
    
    $db->drop_table(tbl => 'next_feature_index');
    $db->create_table(tbl => 'next_feature_index',
		     flds => qq(genome_id varchar(255),
				next_index int
			       )
		     );
}

1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3