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

(-)a/installer/data/mysql/atomicupdate/bug_23049_debit.perl (+6 lines)
Lines 89-94 if ( CheckVersion($DBversion) ) { Link Here
89
          }
89
          }
90
    );
90
    );
91
91
92
    $dbh->do(
93
        qq{
94
        ALTER TABLE accountlines ADD CONSTRAINT `accountlines_check_type` CHECK (accounttype IS NOT NULL OR debit_type IS NOT NULL)
95
        }
96
    );
97
92
    $dbh->do(
98
    $dbh->do(
93
        qq{
99
        qq{
94
        UPDATE accountlines SET debit_type = accounttype, accounttype = NULL WHERE accounttype IN (SELECT code from account_debit_types)
100
        UPDATE accountlines SET debit_type = accounttype, accounttype = NULL WHERE accounttype IN (SELECT code from account_debit_types)
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 2678-2683 CREATE TABLE `accountlines` ( Link Here
2678
  KEY `itemnumber` (`itemnumber`),
2678
  KEY `itemnumber` (`itemnumber`),
2679
  KEY `branchcode` (`branchcode`),
2679
  KEY `branchcode` (`branchcode`),
2680
  KEY `manager_id` (`manager_id`),
2680
  KEY `manager_id` (`manager_id`),
2681
  CONSTRAINT `accountlines_check_type` CHECK (accounttype IS NOT NULL OR debit_type IS NOT NULL),
2681
  CONSTRAINT `accountlines_ibfk_borrowers` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2682
  CONSTRAINT `accountlines_ibfk_borrowers` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2682
  CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2683
  CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2683
  CONSTRAINT `accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2684
  CONSTRAINT `accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2684
- 

Return to bug 23049