Skip to content

Commit 16bd411

Browse files
committed
Remove old migration code from jobs table
These are very old migrations that will be completely irrelevant once we change the table name.
1 parent 8a64937 commit 16bd411

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/JobQueue.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,10 @@ public static function createTable(): void {
2828
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2929
dbDelta( $sql );
3030

31-
// There was an improper unique index which we must be sure to remove
32-
if ( 1 === $wpdb->query( "SHOW INDEX FROM $table_name WHERE KEY_NAME = 'status'" ) ) {
33-
$wpdb->query( "DROP INDEX status ON $table_name" );
34-
}
35-
3631
Controller::ensureIndex(
3732
$table_name,
38-
'status2',
39-
"CREATE INDEX status2 ON $table_name (status)"
33+
'status',
34+
"CREATE INDEX status ON $table_name (status)"
4035
);
4136
}
4237

@@ -53,15 +48,6 @@ public static function addJob( string $job_type, ?int $post_id = null ): void {
5348

5449
$table_name = self::getTableName();
5550

56-
// Add triggering_post_id column if it doesn't exist already
57-
$triggering_post_id_row = $wpdb->get_row(
58-
"SHOW COLUMNS FROM $table_name WHERE Field = 'triggering_post_id'"
59-
);
60-
61-
if ( ! $triggering_post_id_row ) {
62-
self::createTable();
63-
}
64-
6551
// TODO: squash any of same job_types with 'waiting' status
6652
// setting this one to be the one that runs next
6753

0 commit comments

Comments
 (0)