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

(-)a/installer/data/mysql/atomicupdate/bug_24151.perl (+13 lines)
Lines 47-52 if( CheckVersion( $DBversion ) ) { Link Here
47
        VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple')
47
        VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple')
48
    |);
48
    |);
49
49
50
    unless( TableExists( 'pseudonymized_borrower_attributes' ) ) {
51
        $dbh->do(q|
52
            CREATE TABLE pseudonymized_borrower_attributes (
53
              `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Row id field
54
              `transaction_id` int(11) NOT NULL,
55
              `code` varchar(10) NOT NULL,
56
              `attribute` varchar(255) default NULL,
57
              CONSTRAINT `pseudonymized_borrower_attributes_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `pseudonymized_transactions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
58
              CONSTRAINT `anonymized_borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
59
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
60
        |);
61
    }
62
50
    # Always end with this (adjust the bug info)
63
    # Always end with this (adjust the bug info)
51
    SetVersion( $DBversion );
64
    SetVersion( $DBversion );
52
    print "Upgrade to $DBversion done (Bug 24151 - Add pseudonymized_transactions tables and sysprefs for Pseudonymization)\n";
65
    print "Upgrade to $DBversion done (Bug 24151 - Add pseudonymized_transactions tables and sysprefs for Pseudonymization)\n";
(-)a/installer/data/mysql/kohastructure.sql (-1 / +14 lines)
Lines 1916-1921 CREATE TABLE `pseudonymized_transactions` ( Link Here
1916
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1916
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1917
1917
1918
--
1918
--
1919
-- Table structure for table borrower_attributes
1920
--
1921
1922
DROP TABLE IF EXISTS pseudonymized_borrower_attributes;
1923
CREATE TABLE pseudonymized_borrower_attributes ( -- association table between pseudonymized_transactions and borrower_attributes
1924
  `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Row id field
1925
  `transaction_id` int(11) NOT NULL,
1926
  `code` varchar(10) NOT NULL, -- foreign key from the borrower_attribute_types table, defines which custom field this value was entered for
1927
  `attribute` varchar(255) default NULL, -- custom patron field value
1928
  CONSTRAINT `pseudonymized_borrower_attributes_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `pseudonymized_transactions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1929
  CONSTRAINT `anonymized_borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
1930
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1931
1932
--
1919
-- Table structure for table subscription_frequencies
1933
-- Table structure for table subscription_frequencies
1920
--
1934
--
1921
1935
1922
- 

Return to bug 24151