3 use FS::UID qw(adminsuidsetup);
4 use FS::Record qw(dbdef dbh);
7 adminsuidsetup $user or die;
9 foreach my $table ( dbdef->tables ) {
10 my $primary_key = dbdef->table($table)->primary_key;
11 next unless $primary_key;
12 #my $local = dbdef->table($table)->column($primary_key)->local;
13 ##next unless $default =~ /nextval/;
16 my $statement = "select setval('${table}_${primary_key}_seq', ( select max($primary_key) from $table ) )";
18 print "$statement;\n";
21 my $sth = dbh->prepare($statement) or do {
22 warn dbh->errstr. " preparing $statement\n";
26 warn dbh->errstr. " executing $statement\n";