Lines 42-51
GetOptions(
Link Here
|
42 |
my $commenter = Koha::Database::Commenter->new({ database => delete $cmd_args->{database}, dbh => C4::Context->dbh }); |
42 |
my $commenter = Koha::Database::Commenter->new({ database => delete $cmd_args->{database}, dbh => C4::Context->dbh }); |
43 |
if( $cmd_args->{help} ) { |
43 |
if( $cmd_args->{help} ) { |
44 |
pod2usage( -verbose => 2 ); |
44 |
pod2usage( -verbose => 2 ); |
45 |
} elsif( delete $cmd_args->{clear} ) { # clear overrules reset |
45 |
} elsif( ($cmd_args->{clear}||0) + ($cmd_args->{renumber}||0) + ($cmd_args->{reset}||0) > 1 ) { |
|
|
46 |
print "You cannot pass the clear, renumber and reset flags together\n"; |
47 |
} elsif( delete $cmd_args->{clear} ) { |
46 |
alert_dry_run( $cmd_args->{dry_run} ); |
48 |
alert_dry_run( $cmd_args->{dry_run} ); |
47 |
$commenter->clear( $cmd_args ); |
49 |
$commenter->clear( $cmd_args ); |
48 |
} elsif( delete $cmd_args->{reset} ) { # reset overrules renumber |
50 |
} elsif( delete $cmd_args->{reset} ) { |
49 |
alert_dry_run( $cmd_args->{dry_run} ); |
51 |
alert_dry_run( $cmd_args->{dry_run} ); |
50 |
$commenter->reset_to_schema( $cmd_args ); |
52 |
$commenter->reset_to_schema( $cmd_args ); |
51 |
} elsif( delete $cmd_args->{renumber} ) { |
53 |
} elsif( delete $cmd_args->{renumber} ) { |
Lines 106-113
misc/maintenance/sync_db_comments.pl
Link Here
|
106 |
The script is just a wrapper around the module Koha::Database::Commenter. |
108 |
The script is just a wrapper around the module Koha::Database::Commenter. |
107 |
A test script is provided in t/db_dependent/Koha/Database/Commenter.t. |
109 |
A test script is provided in t/db_dependent/Koha/Database/Commenter.t. |
108 |
|
110 |
|
109 |
The flags -clear, -reset and -renumber are mutually exclusive. Clear ignores |
111 |
The flags -clear, -reset and -renumber are mutually exclusive. |
110 |
the other two, reset ignores renumber. |
|
|
111 |
|
112 |
|
112 |
The renumber option has been helpful in verifying that the alter table |
113 |
The renumber option has been helpful in verifying that the alter table |
113 |
operations work on the complete Koha database. It is not recommended to run |
114 |
operations work on the complete Koha database. It is not recommended to run |
114 |
- |
|
|