1 $DBversion = 'XXX'; # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
4 # Add table and add column
6 CREATE TABLE patron_consent (id int AUTO_INCREMENT, borrowernumber int NOT NULL, type enum('GDPR_PROCESSING' ), given_on datetime, refused_on datetime, PRIMARY KEY (id), FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE )
9 ALTER TABLE borrower_modifications ADD COLUMN gdpr_proc_consent datetime
12 # Add two sysprefs too
14 INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free')
17 INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('GDPR_Policy','','Enforced\|Permissive\|Disabled','General Data Protection Regulation - policy', 'Choice')
20 SetVersion( $DBversion );
21 print "Upgrade to $DBversion done (Bug 20819: Add patron_consent)\n";