File: mkaddbtable.pl

package info (click to toggle)
pronto 2.4.0-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,112 kB
  • ctags: 487
  • sloc: perl: 22,159; makefile: 127; sh: 34; sql: 7
file content (22 lines) | stat: -rwxr-xr-x 585 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl -w
# Adds address book table for MySQL/PGSQL .. CSV users don't need to run this.
# run from cscmail dir like this ./migration-scripts/mkaddbtable.pl

BEGIN {
	$libpath = $0;
	$libpath =~ s!/[^/]+$!!;
	$libpath =~ s!/bin$!/lib/cscmail!;
	if (! -e $libpath) { die "Can't find required files in $libpath"; };
}

use lib "$libpath";
use lib "$libpath/modules/lib/perl5/site_perl/5.005";
use DBI;

require 'csclib.pl';
&read_prefs;

my $dbh=&open_db_conn;

$sth1 = $dbh->prepare("create table addresses(id INT, alias TEXT, address TEXT, public_key TEXT)");
$sth1->execute;