File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1111use wcf \system \database \table \column \DefaultFalseBooleanDatabaseTableColumn ;
1212use wcf \system \database \table \column \IntDatabaseTableColumn ;
1313use wcf \system \database \table \column \MediumtextDatabaseTableColumn ;
14- use wcf \system \database \table \index \DatabaseTableIndex ;
14+ use wcf \system \database \table \index \DatabaseTableForeignKey ;
1515use wcf \system \database \table \PartialDatabaseTable ;
1616
1717return [
3232 IntDatabaseTableColumn::create ('imageFileID ' ),
3333 ])
3434 ->indices ([
35- DatabaseTableIndex::create ('imageFileID ' )
36- ->columns (['imageFileID ' ]),
35+ DatabaseTableForeignKey::create ('imageFileID ' )
36+ ->columns (['imageFileID ' ])
37+ ->referencedTable ('wcf1_file ' )
38+ ->referencedColumns (['fileID ' ])
39+ ->onDelete ('SET NULL ' ),
3740 ]),
3841];
Original file line number Diff line number Diff line change @@ -56,4 +56,4 @@ function renameObjectTypes(array &$conditionData): void
5656 unset($ conditionData [$ currentName ]);
5757 }
5858 }
59- }
59+ }
Original file line number Diff line number Diff line change @@ -1506,8 +1506,7 @@ CREATE TABLE wcf1_trophy(
15061506 conditions MEDIUMTEXT,
15071507 isLegacy TINYINT (1 ) NOT NULL DEFAULT 0 ,
15081508 imageFileID INT DEFAULT NULL ,
1509- KEY(categoryID),
1510- KEY imageFileID(imageFileID)
1509+ KEY(categoryID)
15111510);
15121511
15131512DROP TABLE IF EXISTS wcf1_unfurl_url;
@@ -2224,6 +2223,7 @@ ALTER TABLE wcf1_template_group ADD FOREIGN KEY (parentTemplateGroupID) REFERENC
22242223ALTER TABLE wcf1_template_listener ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE ;
22252224
22262225ALTER TABLE wcf1_trophy ADD FOREIGN KEY (categoryID) REFERENCES wcf1_category (categoryID) ON DELETE CASCADE ;
2226+ ALTER TABLE wcf1_trophy ADD FOREIGN KEY (imageFileID) REFERENCES wcf1_file (fileID) ON DELETE SET NULL ;
22272227
22282228ALTER TABLE wcf1_user_collapsible_content ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE ;
22292229ALTER TABLE wcf1_user_collapsible_content ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE ;
You can’t perform that action at this time.
0 commit comments