wp_besked_messages

Static

Stores besked messages data created by this plugin.

Column Definitions

ColumnTypeNullable
🔑idBIGINT(20) UNSIGNEDNO
recipientVARCHAR(20)NO
messageTEXTNO
statusVARCHAR(20)NO
contextVARCHAR(100)YES
order_idBIGINT(20) UNSIGNEDYES
error_messageTEXTYES
retry_countINT(11)NO
max_retriesINT(11)NO
created_atDATETIMENO
sent_atDATETIMEYES
first_nameVARCHAR(100)YES
last_nameVARCHAR(100)YES
phoneVARCHAR(20)NO
emailVARCHAR(255)YES
whatsapp_consentTINYINT(1)NO
consent_dateDATETIMEYES
sourceVARCHAR(50)YES
user_idBIGINT(20) UNSIGNEDYES
unsubscribe_tokenVARCHAR(64)YES
created_atDATETIMENO
updated_atDATETIMENO
session_idVARCHAR(100)NO
user_idBIGINT(20) UNSIGNEDYES
emailVARCHAR(255)YES
phoneVARCHAR(20)YES
first_nameVARCHAR(100)YES
last_nameVARCHAR(100)YES
cart_contentsLONGTEXTNO
cart_totalDECIMAL(10,2)NO
currencyVARCHAR(3)YES
has_consentTINYINT(1)NO
coupon_usedVARCHAR(100)YES
recovery_tokenVARCHAR(64)NO
statusVARCHAR(20)NO
recovered_order_idBIGINT(20) UNSIGNEDYES
abandoned_atDATETIMEYES
recovered_atDATETIMEYES
created_atDATETIMENO
updated_atDATETIMENO
nameVARCHAR(255)NO
enabledTINYINT(1)NO
trigger_delayINT(11)NO
trigger_unitVARCHAR(10)NO
templateTEXTNO
rulesLONGTEXTYES
coupon_enabledTINYINT(1)NO
coupon_typeVARCHAR(20)YES
coupon_amountDECIMAL(10,2)YES
coupon_validity_hoursINT(11)YES
coupon_auto_applyTINYINT(1)NO
priorityINT(11)NO
created_atDATETIMENO
updated_atDATETIMENO
nameVARCHAR(255)NO
descriptionTEXTYES
created_atDATETIMENO
list_idBIGINT(20) UNSIGNEDNO
added_atDATETIMENO
automation_idBIGINT(20) UNSIGNEDNO
cart_idBIGINT(20) UNSIGNEDNO
message_idBIGINT(20) UNSIGNEDYES
coupon_codeVARCHAR(100)YES
coupon_expires_atDATETIMEYES
statusVARCHAR(20)NO
scheduled_atDATETIMENO
sent_atDATETIMEYES
created_atDATETIMENO
nameVARCHAR(255)NO
messageTEXTNO
list_idsTEXTNO
scheduled_atDATETIMEYES
statusVARCHAR(20)NO
sent_countINT(11) UNSIGNEDNO
failed_countINT(11) UNSIGNEDNO
attachment_idBIGINT(20) UNSIGNEDYES
media_urlVARCHAR(500)YES
media_typeVARCHAR(20)YES
media_filenameVARCHAR(255)YES
created_atDATETIMENO
updated_atDATETIMENO
campaign_idBIGINT(20) UNSIGNEDNO
contact_idBIGINT(20) UNSIGNEDNO
phoneVARCHAR(20)NO
statusVARCHAR(20)NO
error_messageTEXTYES
sent_atDATETIMEYES
created_atDATETIMENO

CREATE TABLE Statement

CREATE TABLE IF NOT EXISTS wp_besked_messages ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, recipient VARCHAR(20) NOT NULL, message TEXT NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'pending', context VARCHAR(100) DEFAULT NULL, order_id BIGINT(20) UNSIGNED DEFAULT NULL, error_message TEXT DEFAULT NULL, retry_count INT(11) NOT NULL DEFAULT 0, max_retries INT(11) NOT NULL DEFAULT 5, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, sent_at DATETIME DEFAULT NULL, PRIMARY KEY (id), KEY idx_status (status), KEY idx_created_at (created_at), KEY idx_order_id (order_id) ) $charset_collate;"; $sql_contacts = "CREATE TABLE IF NOT EXISTS wp_besked_contacts ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, first_name VARCHAR(100) DEFAULT NULL, last_name VARCHAR(100) DEFAULT NULL, phone VARCHAR(20) NOT NULL, email VARCHAR(255) DEFAULT NULL, whatsapp_consent TINYINT(1) NOT NULL DEFAULT 0, consent_date DATETIME DEFAULT NULL, source VARCHAR(50) DEFAULT 'checkout', user_id BIGINT(20) UNSIGNED DEFAULT NULL, unsubscribe_token VARCHAR(64) DEFAULT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY idx_phone (phone), UNIQUE KEY idx_unsubscribe_token (unsubscribe_token), KEY idx_consent (whatsapp_consent), KEY idx_user_id (user_id), KEY idx_email (email) ) $charset_collate;"; $sql_abandoned_carts = "CREATE TABLE IF NOT EXISTS wp_besked_abandoned_carts ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, session_id VARCHAR(100) NOT NULL, user_id BIGINT(20) UNSIGNED DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, phone VARCHAR(20) DEFAULT NULL, first_name VARCHAR(100) DEFAULT NULL, last_name VARCHAR(100) DEFAULT NULL, cart_contents LONGTEXT NOT NULL, cart_total DECIMAL(10,2) NOT NULL DEFAULT 0, currency VARCHAR(3) DEFAULT 'EUR', has_consent TINYINT(1) NOT NULL DEFAULT 0, coupon_used VARCHAR(100) DEFAULT NULL, recovery_token VARCHAR(64) NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'active', recovered_order_id BIGINT(20) UNSIGNED DEFAULT NULL, abandoned_at DATETIME DEFAULT NULL, recovered_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY idx_recovery_token (recovery_token), KEY idx_session_id (session_id), KEY idx_status (status), KEY idx_email (email), KEY idx_phone (phone), KEY idx_abandoned_at (abandoned_at), KEY idx_user_id (user_id) ) $charset_collate;"; $sql_cart_automations = "CREATE TABLE IF NOT EXISTS wp_besked_cart_automations ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL DEFAULT 0, trigger_delay INT(11) NOT NULL DEFAULT 60, trigger_unit VARCHAR(10) NOT NULL DEFAULT 'minutes', template TEXT NOT NULL, rules LONGTEXT DEFAULT NULL, coupon_enabled TINYINT(1) NOT NULL DEFAULT 0, coupon_type VARCHAR(20) DEFAULT 'percent', coupon_amount DECIMAL(10,2) DEFAULT 0, coupon_validity_hours INT(11) DEFAULT 72, coupon_auto_apply TINYINT(1) NOT NULL DEFAULT 0, priority INT(11) NOT NULL DEFAULT 0, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY idx_enabled (enabled), KEY idx_priority (priority) ) $charset_collate;"; $sql_lists = "CREATE TABLE IF NOT EXISTS wp_besked_lists ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id) ) $charset_collate;"; $sql_contact_lists = "CREATE TABLE IF NOT EXISTS wp_besked_contact_lists ( contact_id BIGINT(20) UNSIGNED NOT NULL, list_id BIGINT(20) UNSIGNED NOT NULL, added_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (contact_id, list_id), KEY idx_list_id (list_id) ) $charset_collate;"; $sql_cart_automation_logs = "CREATE TABLE IF NOT EXISTS wp_besked_cart_automation_logs ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, automation_id BIGINT(20) UNSIGNED NOT NULL, cart_id BIGINT(20) UNSIGNED NOT NULL, message_id BIGINT(20) UNSIGNED DEFAULT NULL, coupon_code VARCHAR(100) DEFAULT NULL, coupon_expires_at DATETIME DEFAULT NULL, status VARCHAR(20) NOT NULL DEFAULT 'scheduled', scheduled_at DATETIME NOT NULL, sent_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY idx_status_scheduled (status, scheduled_at), KEY idx_cart_id (cart_id), KEY idx_automation_id (automation_id) ) $charset_collate;"; $sql_campaigns = "CREATE TABLE IF NOT EXISTS wp_besked_campaigns ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL DEFAULT '', message TEXT NOT NULL, list_ids TEXT NOT NULL DEFAULT '[]', scheduled_at DATETIME NULL DEFAULT NULL, status VARCHAR(20) NOT NULL DEFAULT 'draft', sent_count INT(11) UNSIGNED NOT NULL DEFAULT 0, failed_count INT(11) UNSIGNED NOT NULL DEFAULT 0, attachment_id BIGINT(20) UNSIGNED NULL DEFAULT NULL, media_url VARCHAR(500) NULL DEFAULT NULL, media_type VARCHAR(20) NULL DEFAULT NULL, media_filename VARCHAR(255) NULL DEFAULT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY idx_status (status), KEY idx_scheduled_at (scheduled_at) ) $charset_collate;"; $sql_campaign_logs = "CREATE TABLE IF NOT EXISTS wp_besked_campaign_logs ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, campaign_id BIGINT(20) UNSIGNED NOT NULL, contact_id BIGINT(20) UNSIGNED NOT NULL, phone VARCHAR(20) NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'pending', error_message TEXT DEFAULT NULL, sent_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY idx_campaign_id (campaign_id), KEY idx_status (status) ) $charset_collate;"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $sql_messages );

Safe to delete?

If you have uninstalled Besked Notifications, this table is generally safe to remove. However, always back up your database first.

Note: Some plugins share tables or are dependencies of other plugins. Verify nothing else depends on this table before dropping it.

How to remove this table

DROP TABLE IF EXISTS `wp_besked_messages`;

Run this query using phpMyAdmin, Adminer, or your MySQL client. Back up first.

Other tables from Besked Notifications