4 use vars qw( @ISA @EXPORT_OK );
7 use FS::UID qw( dbh driver_name );
11 $FS::svc_domain::whois_hack = 1;
13 @ISA = qw( Exporter );
14 @EXPORT_OK = qw( upgrade );
18 FS::Upgrade - Database upgrade routines
26 Currently this module simply provides a place to store common subroutines for
40 my $oldAutoCommit = $FS::UID::AutoCommit;
41 local $FS::UID::AutoCommit = 0;
42 $FS::UID::AutoCommit = 0;
44 my $data = upgrade_data(%opt);
46 foreach my $table ( keys %$data ) {
48 my $class = "FS::$table";
52 if ( $class->can('_upgrade_data') ) {
53 $class->_upgrade_data(%opt);
55 warn "WARNING: asked for upgrade of $table,".
56 " but FS::$table has no _upgrade_data method\n";
59 # my @records = @{ $data->{$table} };
61 # foreach my $record ( @records ) {
62 # my $args = delete($record->{'_upgrade_args'}) || [];
63 # my $object = $class->new( $record );
64 # my $error = $object->insert( @$args );
65 # die "error inserting record into $table: $error\n"
71 if ( $oldAutoCommit ) {
72 dbh->commit or die dbh->errstr;
81 tie my %hash, 'Tie::IxHash',
83 #reason type and reasons
90 #duplicate history records
93 #populate cust_pay.otaker
96 #populate part_pkg_taxclass for starters
97 'part_pkg_taxclass' => [],