freeside/bin add-history-records.pl,NONE,1.1
Kristian Hoffmann
khoff at pouncequick.420.am
Wed Mar 30 12:55:20 PST 2005
Update of /home/cvs/cvsroot/freeside/bin
In directory pouncequick:/tmp/cvs-serv28354
Added Files:
add-history-records.pl
Log Message:
Test script to add pre-history table history records.
--- NEW FILE: add-history-records.pl ---
#!/usr/bin/perl
use strict;
use FS::UID qw(adminsuidsetup);
use FS::Record qw(qsearchs qsearch);
use FS::svc_domain;
use FS::h_svc_domain;
use FS::domain_record;
use FS::h_domain_record;
use Data::Dumper;
adminsuidsetup(shift);
my $svcnum = shift;
my $svc_domain = qsearchs('svc_domain', { svcnum => $svcnum }) or die "no svcnum '$svcnum'";
my $h_svc_domain = qsearchs(
'h_svc_domain',
{ 'svcnum' => $svc_domain->svcnum },
FS::h_svc_domain->sql_h_searchs(time),
);
unless ($h_svc_domain) {
print $svc_domain->_h_statement('insert', 1) . "\n";
}
foreach my $rec ($svc_domain->domain_record) {
my $h_rec = qsearchs(
'h_domain_record',
{ 'svcnum' => $svc_domain->svcnum },
FS::h_domain_record->sql_h_searchs(time),
);
#print Dumper($h_rec);
unless ($h_rec) {
print $rec->_h_statement('insert', 1) . "\n";
}
}
More information about the freeside-commits
mailing list