Lines 36-47
GetOptions(
Link Here
|
36 |
'help|h' => \$cmd_args->{help}, |
36 |
'help|h' => \$cmd_args->{help}, |
37 |
'renumber' => \$cmd_args->{renumber}, |
37 |
'renumber' => \$cmd_args->{renumber}, |
38 |
'reset' => \$cmd_args->{reset}, |
38 |
'reset' => \$cmd_args->{reset}, |
|
|
39 |
'schema:s' => \$cmd_args->{schema_file}, |
39 |
'table:s' => \$cmd_args->{table}, |
40 |
'table:s' => \$cmd_args->{table}, |
40 |
'verbose|v' => \$cmd_args->{verbose}, |
41 |
'verbose|v' => \$cmd_args->{verbose}, |
41 |
); |
42 |
); |
42 |
$cmd_args->{dry_run} = !$cmd_args->{commit}; |
43 |
$cmd_args->{dry_run} = !$cmd_args->{commit}; |
43 |
|
44 |
|
44 |
my $commenter = Koha::Database::Commenter->new({ database => delete $cmd_args->{database}, dbh => C4::Context->dbh }); |
45 |
my $commenter = Koha::Database::Commenter->new({ |
|
|
46 |
database => delete $cmd_args->{database}, |
47 |
dbh => C4::Context->dbh, |
48 |
schema_file => delete $cmd_args->{schema_file}, |
49 |
}); |
45 |
my $messages = $cmd_args->{verbose} || $cmd_args->{dry_run} ? [] : undef; |
50 |
my $messages = $cmd_args->{verbose} || $cmd_args->{dry_run} ? [] : undef; |
46 |
if( $cmd_args->{help} ) { |
51 |
if( $cmd_args->{help} ) { |
47 |
pod2usage( -verbose => 2 ); |
52 |
pod2usage( -verbose => 2 ); |
Lines 71-77
misc/maintenance/sync_db_comments.pl
Link Here
|
71 |
|
76 |
|
72 |
=head1 SYNOPSIS |
77 |
=head1 SYNOPSIS |
73 |
|
78 |
|
74 |
perl sync_db_comments.pl [-h] [-v] [-database DB_NAME] [-table TABLE_NAME] [-commit] [-clear|-reset|-renumber] |
79 |
perl sync_db_comments.pl [-h] [-v] [-database DB_NAME] [-table TABLE_NAME] [-schema SCHEMA_FILE] [-commit] [-clear|-reset|-renumber] |
75 |
|
80 |
|
76 |
=head1 DESCRIPTION |
81 |
=head1 DESCRIPTION |
77 |
|
82 |
|
Lines 91-99
misc/maintenance/sync_db_comments.pl
Link Here
|
91 |
Clear all column comments in database. |
96 |
Clear all column comments in database. |
92 |
The verbose flag shows all issued ALTER TABLE statements. |
97 |
The verbose flag shows all issued ALTER TABLE statements. |
93 |
|
98 |
|
94 |
misc/maintance/sync_db_comments.pl -reset -commit -database mydb -table items |
99 |
misc/maintance/sync_db_comments.pl -reset -commit -database mydb -table items -schema newstructure.sql |
95 |
Only resets comments in items table. |
100 |
Only resets comments in items table. |
96 |
Operates on specific database instead of the one from $KOHA_CONF. |
101 |
Operates on specific database instead of the one from $KOHA_CONF. |
|
|
102 |
Reads the schema from the specified file instead of default one. |
97 |
|
103 |
|
98 |
misc/maintance/sync_db_comments.pl -renumber |
104 |
misc/maintance/sync_db_comments.pl -renumber |
99 |
Renumbers all comments like Comment_1,2,.. |
105 |
Renumbers all comments like Comment_1,2,.. |
100 |
- |
|
|