You appear to be a bot. Output may be restricted
Description
When the actions table is created, set its autoincrement value to be one higher than the posts table to ensure that there are no ID collisions.
Usage
$void = ActionScheduler_HybridStore::set_autoincrement( $table_name, $table_suffix );
Parameters
- $table_name
- ( string ) required –
- $table_suffix
- ( string ) required –
Returns
void
Source
File name: woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php
Lines:
1 to 39 of 39
public function set_autoincrement( $table_name, $table_suffix ) { if ( ActionScheduler_StoreSchema::ACTIONS_TABLE === $table_suffix ) { if ( empty( $this->demarkation_id ) ) { $this->demarkation_id = $this->set_demarkation_id(); } /** @var \wpdb $wpdb */ global $wpdb; /** * A default date of '0000-00-00 00:00:00' is invalid in MySQL 5.7 when configured with * sql_mode including both STRICT_TRANS_TABLES and NO_ZERO_DATE. */ $default_date = new DateTime( 'tomorrow' ); $null_action = new ActionScheduler_NullAction(); $date_gmt = $this->get_scheduled_date_string( $null_action, $default_date ); $date_local = $this->get_scheduled_date_string_local( $null_action, $default_date ); $row_count = $wpdb->insert( $wpdb->{ActionScheduler_StoreSchema::ACTIONS_TABLE}, [ 'action_id' => $this->demarkation_id, 'hook' => '', 'status' => '', 'scheduled_date_gmt' => $date_gmt, 'scheduled_date_local' => $date_local, 'last_attempt_gmt' => $date_gmt, 'last_attempt_local' => $date_local, ] ); if ( $row_count > 0 ) { $wpdb->delete( $wpdb->{ActionScheduler_StoreSchema::ACTIONS_TABLE}, [ 'action_id' => $this->demarkation_id ] ); } } }