Skip to content
Barry Hughes edited this page May 23, 2023 · 1 revision

The database tables used by the default DBStore are as follows (assuming version 3.5.4). These might be handy if you need to recreate them, however it is generally always preferable to do this by navigating to the Tools ▸ Scheduled Actions admin screen (when you visit this page, Action Scheduler will attempt to regenerate the tables if it detects they are missing):

Actions table

CREATE TABLE wp_actionscheduler_actions (
    action_id bigint(20) unsigned NOT NULL auto_increment,
    hook varchar(191) NOT NULL,
    status varchar(20) NOT NULL,
    scheduled_date_gmt datetime NULL default '0000-00-00 00:00:00',
    scheduled_date_local datetime NULL default '0000-00-00 00:00:00',
    args varchar(191),
    schedule longtext,
    group_id bigint(20) unsigned NOT NULL default '0',
    attempts int(11) NOT NULL default '0',
    last_attempt_gmt datetime NULL default '0000-00-00 00:00:00',
    last_attempt_local datetime NULL default '0000-00-00 00:00:00',
    claim_id bigint(20) unsigned NOT NULL default '0',
    extended_args varchar(8000) DEFAULT NULL,
    PRIMARY KEY  (action_id),
    KEY hook (hook(191)),
    KEY status (status),
    KEY scheduled_date_gmt (scheduled_date_gmt),
    KEY args (args(191)),
    KEY group_id (group_id),
    KEY last_attempt_gmt (last_attempt_gmt),
    KEY `claim_id_status_scheduled_date_gmt` (`claim_id`, `status`, `scheduled_date_gmt`)
);

Claims table

CREATE TABLE wp_actionscheduler_claims (
    claim_id bigint(20) unsigned NOT NULL auto_increment,
    date_created_gmt datetime NULL default '0000-00-00 00:00:00',
    PRIMARY KEY  (claim_id),
    KEY date_created_gmt (date_created_gmt)
);

Groups table

CREATE TABLE wp_actionscheduler_groups (
    group_id bigint(20) unsigned NOT NULL auto_increment,
    slug varchar(255) NOT NULL,
    PRIMARY KEY  (group_id),
    KEY slug (slug(191))
);

Log table

CREATE TABLE wp_actionscheduler_log (
    log_id bigint(20) unsigned NOT NULL auto_increment,
    action_id bigint(20) unsigned NOT NULL,
    message text NOT NULL,
    log_date_gmt datetime NULL default '0000-00-00 00:00:00',
    log_date_local datetime NULL default '0000-00-00 00:00:00',
    PRIMARY KEY  (log_id),
    KEY action_id (action_id),
    KEY log_date_gmt (log_date_gmt)
);

Notes

  • The relevant code can be found in classes/schema.
  • The above snippets do not specify the collation and assume a default table prefix (of wp_).
Clone this wiki locally