Bug 17960: Replace missing occurrences
[koha.git] / installer / data / mysql / atomicupdate / bug_17960.perl
1 $DBversion = 'XXX';
2 if( CheckVersion( $DBversion ) ) {
3
4     if ( column_exists('opac_news', 'new' ) ) {
5         $dbh->do(q|ALTER TABLE opac_news CHANGE COLUMN new content text NOT NULL|);
6     }
7
8     my ( $used_in_templates ) = $dbh->selectrow_array(q|
9         SELECT COUNT(*) FROM letter WHERE content LIKE "%<<opac_news.new>>%";
10     |);
11     if ( $used_in_templates ) {
12         print "WARNING - It seems that you are using the opac_news.new column in your notice templates\n";
13         print "Since it has now been renamed with opac_news.content, you should update them.\n";
14     }
15
16     SetVersion( $DBversion );
17     print "Upgrade to $DBversion done (Bug 17960 - Rename opac_news with opac_news.content)\n";
18 }