| Lines 26-31
          use C4::Installer::PerlModules;
      
      
        Link Here | 
        
          | 26 | use DBI; | 26 | use DBI; | 
        
          | 27 | use Koha; | 27 | use Koha; | 
        
          | 28 |  | 28 |  | 
            
              |  |  | 29 | use vars qw(@ISA @EXPORT); | 
            
              | 30 | BEGIN { | 
            
              | 31 |     require Exporter; | 
            
              | 32 |     @ISA = qw( Exporter ); | 
            
              | 33 |     push @EXPORT, qw( constraint_exists column_exists ); | 
            
              | 34 | }; | 
            
              | 35 |  | 
        
          | 29 | =head1 NAME | 36 | =head1 NAME | 
        
          | 30 |  | 37 |  | 
        
          | 31 | C4::Installer | 38 | C4::Installer | 
  
    | Lines 491-496
          sub get_file_path_from_name {
      
      
        Link Here | 
        
          | 491 |  | 498 |  | 
        
          | 492 | } | 499 | } | 
        
          | 493 |  | 500 |  | 
            
              |  |  | 501 | sub constraint_exists { | 
            
              | 502 |     my ( $table_name, $key_name ) = @_; | 
            
              | 503 |     my $dbh = C4::Context->dbh; | 
            
              | 504 |     my ($exists) = $dbh->selectrow_array( | 
            
              | 505 |         qq| | 
            
              | 506 |         SHOW INDEX FROM $table_name | 
            
              | 507 |         WHERE key_name = ? | 
            
              | 508 |         |, undef, $key_name | 
            
              | 509 |     ); | 
            
              | 510 |     return $exists; | 
            
              | 511 | } | 
            
              | 512 |  | 
            
              | 513 | sub column_exists { | 
            
              | 514 |     my ( $table_name, $column_name ) = @_; | 
            
              | 515 |     my $dbh = C4::Context->dbh; | 
            
              | 516 |     my ($exists) = $dbh->selectrow_array( | 
            
              | 517 |         qq| | 
            
              | 518 |         SHOW COLUMNS FROM $table_name | 
            
              | 519 |         WHERE Field = ? | 
            
              | 520 |         |, undef, $column_name | 
            
              | 521 |     ); | 
            
              | 522 |     return $exists; | 
            
              | 523 | } | 
        
          | 494 |  | 524 |  | 
        
          | 495 | =head1 AUTHOR | 525 | =head1 AUTHOR | 
        
          | 496 |  | 526 |  |