View | Details | Raw Unified | Return to bug 21401
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_21401_account_offsets_transaction_library.perl (+10 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !column_exists( 'account_offsets', 'transaction_library' ) ) {
4
        $dbh->do( "ALTER TABLE account_offsets ADD COLUMN transaction_library varchar(10) default NULL AFTER created_on" );
5
        $dbh->do( "ALTER TABLE account_offsets ADD CONSTRAINT `account_offsets_ibfk_l` FOREIGN KEY (`transaction_library`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE" );
6
    }
7
8
    SetVersion( $DBversion );
9
    print "Upgrade to $DBversion done (Bug 21401 - Add transacting library to account_offsets)\n";
10
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +3 lines)
Lines 2717-2726 CREATE TABLE `account_offsets` ( Link Here
2717
  `type` varchar(16) NOT NULL, -- The type of offset this is
2717
  `type` varchar(16) NOT NULL, -- The type of offset this is
2718
  `amount` decimal(26,6) NOT NULL, -- The amount of the change
2718
  `amount` decimal(26,6) NOT NULL, -- The amount of the change
2719
  `created_on` timestamp NOT NULL default CURRENT_TIMESTAMP,
2719
  `created_on` timestamp NOT NULL default CURRENT_TIMESTAMP,
2720
  `transaction_library` varchar(10) default NULL, -- library where the offset was made
2720
  PRIMARY KEY (`id`),
2721
  PRIMARY KEY (`id`),
2721
  CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2722
  CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2722
  CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2723
  CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2723
  CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE
2724
  CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE,
2725
  CONSTRAINT `account_offsets_ibfk_l` FOREIGN KEY (`transaction_library`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
2724
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2726
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2725
2727
2726
--
2728
--
2727
- 

Return to bug 21401