Bug 19066: (RM follow-up) Fix test count and structure error
[koha.git] / installer / data / mysql / atomicupdate / bug_19066_add_accountlines_branchcode.perl
1 $DBversion = 'XXX';  # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
3
4     if( !column_exists( 'accountlines', 'branchcode' ) ) {
5         $dbh->do("ALTER TABLE accountlines ADD branchcode VARCHAR( 10 ) NULL DEFAULT NULL AFTER manager_id");
6         $dbh->do("ALTER TABLE accountlines ADD CONSTRAINT accountlines_ibfk_branches FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE SET NULL ON UPDATE CASCADE");
7     }
8
9     # Always end with this (adjust the bug info)
10     SetVersion( $DBversion );
11     print "Upgrade to $DBversion done (Bug 19066 - Add branchcode to accountlines)\n";
12 }