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 1971-1976 CREATE TABLE `pseudonymized_transactions` ( Link Here
1971
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1971
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1972
1972
1973
--
1973
--
1974
-- Table structure for table borrower_attributes
1975
--
1976
1977
DROP TABLE IF EXISTS pseudonymized_borrower_attributes;
1978
CREATE TABLE pseudonymized_borrower_attributes ( -- association table between pseudonymized_transactions and borrower_attributes
1979
  `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Row id field
1980
  `transaction_id` int(11) NOT NULL,
1981
  `code` varchar(10) NOT NULL, -- foreign key from the borrower_attribute_types table, defines which custom field this value was entered for
1982
  `attribute` varchar(255) default NULL, -- custom patron field value
1983
  CONSTRAINT `pseudonymized_borrower_attributes_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `pseudonymized_transactions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
1984
  CONSTRAINT `anonymized_borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
1985
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1986
1987
--
1974
-- Table structure for table subscription_frequencies
1988
-- Table structure for table subscription_frequencies
1975
--
1989
--
1976
1990
1977
- 

Return to bug 24151