File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252
5353 <!--
5454 Required order of the following steps for the update to 6.2:
55+ <instruction type="script">acp/update_com.woltlab.wcf_6.2_backgroundJob.php</instruction>
5556 <instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_62_step1.php</instruction>
5657 <instruction type="script">acp/update_com.woltlab.wcf_6.2_contactOptions.php</instruction>
5758 <instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_62_step2.php</instruction>
Original file line number Diff line number Diff line change 1010
1111use wcf \system \database \table \column \IntDatabaseTableColumn ;
1212use wcf \system \database \table \column \MediumtextDatabaseTableColumn ;
13- use wcf \system \database \table \column \TextDatabaseTableColumn ;
14- use wcf \system \database \table \column \TinyintDatabaseTableColumn ;
1513use wcf \system \database \table \index \DatabaseTableForeignKey ;
14+ use wcf \system \database \table \index \DatabaseTableIndex ;
1615use wcf \system \database \table \PartialDatabaseTable ;
1716
1817return [
18+ PartialDatabaseTable::create ('wcf1_background_job ' )
19+ ->indices ([
20+ DatabaseTableIndex::create ('identifier ' )
21+ ->type (DatabaseTableIndex::UNIQUE_TYPE )
22+ ->columns (['identifier ' ]),
23+ ]),
1924 PartialDatabaseTable::create ('wcf1_user ' )
2025 ->columns ([
2126 IntDatabaseTableColumn::create ('avatarFileID ' )
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * This script removes duplicate background jobs.
5+ */
6+
7+ use wcf \system \WCF ;
8+
9+ $ sql = "DELETE background_jobs
10+ FROM wcf1_background_job background_jobs
11+ JOIN (
12+ SELECT MIN(jobID) as keepID, identifier
13+ FROM wcf1_background_job
14+ WHERE identifier IS NOT NULL
15+ GROUP BY identifier
16+ HAVING COUNT(*) > 1
17+ ) AS duplicates
18+ ON background_jobs.identifier = duplicates.identifier
19+ WHERE background_jobs.jobID <> duplicates.keepID " ;
20+ $ statement = WCF ::getDB ()->prepare ($ sql );
21+ $ statement ->execute ();
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ CREATE TABLE wcf1_background_job (
241241 time INT (10 ) NOT NULL ,
242242 identifier VARCHAR (191 ) NULL ,
243243
244- KEY identifier (identifier),
244+ UNIQUE KEY identifier (identifier),
245245 KEY (status, time )
246246);
247247
You can’t perform that action at this time.
0 commit comments