use Exporter;
#use Tie::DxHash;
use Tie::IxHash;
-use FS::UID qw( dbh );
+use FS::UID qw( dbh driver_name );
use FS::Record;
use FS::svc_domain;
populate_locales();
+ populate_duplock();
+
#initial_data data
populate_initial_data(%opt);
die $error if $error;
}
+sub populate_duplock {
+
+ return unless driver_name =~ /^mysql/i;
+
+ my $sth = dbh->prepare(
+ "INSERT INTO duplicate_lock ( lockname ) VALUES ( 'svc_acct' )"
+ ) or die dbh->errstr;
+
+ $sth->execute or die $sth->errstr;
+
+}
+
sub populate_initial_data {
my %opt = @_;
eval "use $class;";
die $@ if $@;
+ $class->_populate_initial_data(%opt)
+ if $class->can('_populate_inital_data');
+
my @records = @{ $data->{$table} };
foreach my $record ( @records ) {
{ 'groupname' => 'Superuser' },
],
+ #reason types
+ 'reason_type' => [],
+
#XXX need default new-style billing events
# #billing events
# 'part_bill_event' => [
'en_US' => 'Driver\'s License State',
},
+ 'invalid_domain' => {
+ 'en_US' => 'Invalid domain',
+ },
+
);
}