62 |
if (/^\s*(\w+)\s+/) { |
if (/^\s*(\w+)\s+/) { |
63 |
$seq="${table}_${1}_seq"; |
$seq="${table}_${1}_seq"; |
64 |
push @sequences,"$table.$1"; |
push @sequences,"$table.$1"; |
65 |
s/\w*int.*auto_increment/int4 default nextval('$seq') not null/ig; |
s/(\w+) \w*int.*auto_increment/$1 int4 default nextval('$seq') not null/ig; |
66 |
} else { |
} else { |
67 |
die "can't get name of field!"; |
die "can't get name of field!"; |
68 |
} |
} |
157 |
print STDERR "$sql\n"; |
print STDERR "$sql\n"; |
158 |
$sth = $dbh->prepare($sql) || die $dbh->errstr(); |
$sth = $dbh->prepare($sql) || die $dbh->errstr(); |
159 |
$sth->execute() || die $sth->errstr(); |
$sth->execute() || die $sth->errstr(); |
160 |
($start) = $sth->fetchrow_array(); |
($start) = $sth->fetchrow_array() || 1; |
161 |
|
|
162 |
$seq="${table}_${field}_seq"; |
$seq="${table}_${field}_seq"; |
163 |
|
|