Bug 11879: DBIC schema changes
[koha.git] / installer / data / mysql / atomicupdate / borrowers_primary_contact_method.perl
1 $DBversion = 'XXX'; # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
3     if( !column_exists( 'borrowers', 'primary_contact_method' ) ) {
4         $dbh->do( "ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" );
5     }
6
7     if( !column_exists( 'deletedborrowers', 'primary_contact_method' ) ) {
8         $dbh->do( "ALTER TABLE `deletedborrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `autorenew_checkouts`" );
9     }
10
11     if( !column_exists( 'borrower_modifications', 'primary_contact_method' ) ) {
12         $dbh->do( "ALTER TABLE `borrower_modifications` ADD COLUMN `primary_contact_method` VARCHAR(45) DEFAULT NULL AFTER `gdpr_proc_consent`" );
13     }
14
15     SetVersion( $DBversion );
16     print "Upgrade to $DBversion done (Bug 11879 - Add a new field to patron record: main contact method)\n";
17 }