| 1 |
<?php |
| 2 |
|
| 3 |
// Note: not localised as the messages aren't important enough |
| 4 |
class Red_Database_233 extends Red_Database_Upgrader { |
| 5 |
public function get_stages() { |
| 6 |
return [ |
| 7 |
'fix_invalid_groups_233' => 'Migrate any groups with invalid module ID', |
| 8 |
]; |
| 9 |
} |
| 10 |
|
| 11 |
protected function fix_invalid_groups_233( $wpdb ) { |
| 12 |
$this->do_query( $wpdb, "UPDATE {$wpdb->prefix}redirection_groups SET module_id=1 WHERE module_id > 2" ); |
| 13 |
|
| 14 |
$latest = Red_Database::get_latest_database(); |
| 15 |
return $latest->create_groups( $wpdb ); |
| 16 |
} |
| 17 |
} |
| 18 |
|