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 $class->_upgrade_data(%opt)
53 if $class->can('_upgrade_data');
55 # my @records = @{ $data->{$table} };
57 # foreach my $record ( @records ) {
58 # my $args = delete($record->{'_upgrade_args'}) || [];
59 # my $object = $class->new( $record );
60 # my $error = $object->insert( @$args );
61 # die "error inserting record into $table: $error\n"
67 if ( $oldAutoCommit ) {
68 dbh->commit or die dbh->errstr;
77 tie my %hash, 'Tie::IxHash',
79 #reason type and reasons