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 488-493
sub get_file_path_from_name {
Link Here
|
488 |
|
495 |
|
489 |
} |
496 |
} |
490 |
|
497 |
|
|
|
498 |
sub constraint_exists { |
499 |
my ( $table_name, $key_name ) = @_; |
500 |
my $dbh = C4::Context->dbh; |
501 |
my ($exists) = $dbh->selectrow_array( |
502 |
qq| |
503 |
SHOW INDEX FROM $table_name |
504 |
WHERE key_name = ? |
505 |
|, undef, $key_name |
506 |
); |
507 |
return $exists; |
508 |
} |
509 |
|
510 |
sub column_exists { |
511 |
my ( $table_name, $column_name ) = @_; |
512 |
my $dbh = C4::Context->dbh; |
513 |
my ($exists) = $dbh->selectrow_array( |
514 |
qq| |
515 |
SHOW COLUMNS FROM $table_name |
516 |
WHERE Field = ? |
517 |
|, undef, $column_name |
518 |
); |
519 |
return $exists; |
520 |
} |
491 |
|
521 |
|
492 |
=head1 AUTHOR |
522 |
=head1 AUTHOR |
493 |
|
523 |
|