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

(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 58-64 CREATE TABLE `auth_subfield_structure` ( Link Here
58
  `frameworkcode` varchar(10) NOT NULL default '',
58
  `frameworkcode` varchar(10) NOT NULL default '',
59
  `defaultvalue` TEXT DEFAULT '',
59
  `defaultvalue` TEXT DEFAULT '',
60
  PRIMARY KEY  (`authtypecode`,`tagfield`,`tagsubfield`),
60
  PRIMARY KEY  (`authtypecode`,`tagfield`,`tagsubfield`),
61
  KEY `tab` (`authtypecode`,`tab`)
61
  KEY `tab` (`authtypecode`,`tab`),
62
  CONSTRAINT `auth_subfield_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
62
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
63
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
63
64
64
--
65
--
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +18 lines)
Lines 9902-9907 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
9902
    SetVersion ($DBversion);
9902
    SetVersion ($DBversion);
9903
}
9903
}
9904
9904
9905
$DBversion = "3.19.00.XXX";
9906
if ( CheckVersion($DBversion) ) {
9907
    $dbh->do(q{
9908
        DELETE ass.*
9909
        FROM auth_subfield_structure AS ass
9910
        LEFT JOIN auth_types USING(authtypecode)
9911
        WHERE auth_types.authtypecode IS NULL
9912
    });
9913
9914
    $dbh->do(q{
9915
        ALTER TABLE auth_subfield_structure
9916
        ADD CONSTRAINT auth_subfield_structure_ibfk_1 FOREIGN KEY (authtypecode) REFERENCES auth_types(authtypecode) ON DELETE CASCADE ON UPDATE CASCADE
9917
    });
9918
9919
    print "Upgrade to $DBversion done (Bug 8480 - Add foreign key on auth_subfield_structure.authtypecode)\n";
9920
    SetVersion($DBversion);
9921
}
9922
9905
=head1 FUNCTIONS
9923
=head1 FUNCTIONS
9906
9924
9907
=head2 TableExists($table)
9925
=head2 TableExists($table)
9908
- 

Return to bug 8480