1 $DBversion = 'XXX'; # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
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");
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";