wp_besked_messages
StaticStores besked messages data created by this plugin.
Column Definitions
| Column | Type | Nullable |
|---|---|---|
| 🔑id | BIGINT(20) UNSIGNED | NO |
| recipient | VARCHAR(20) | NO |
| message | TEXT | NO |
| status | VARCHAR(20) | NO |
| context | VARCHAR(100) | YES |
| order_id | BIGINT(20) UNSIGNED | YES |
| error_message | TEXT | YES |
| retry_count | INT(11) | NO |
| max_retries | INT(11) | NO |
| created_at | DATETIME | NO |
| sent_at | DATETIME | YES |
| first_name | VARCHAR(100) | YES |
| last_name | VARCHAR(100) | YES |
| phone | VARCHAR(20) | NO |
| VARCHAR(255) | YES | |
| whatsapp_consent | TINYINT(1) | NO |
| consent_date | DATETIME | YES |
| source | VARCHAR(50) | YES |
| user_id | BIGINT(20) UNSIGNED | YES |
| unsubscribe_token | VARCHAR(64) | YES |
| created_at | DATETIME | NO |
| updated_at | DATETIME | NO |
| session_id | VARCHAR(100) | NO |
| user_id | BIGINT(20) UNSIGNED | YES |
| VARCHAR(255) | YES | |
| phone | VARCHAR(20) | YES |
| first_name | VARCHAR(100) | YES |
| last_name | VARCHAR(100) | YES |
| cart_contents | LONGTEXT | NO |
| cart_total | DECIMAL(10,2) | NO |
| currency | VARCHAR(3) | YES |
| has_consent | TINYINT(1) | NO |
| coupon_used | VARCHAR(100) | YES |
| recovery_token | VARCHAR(64) | NO |
| status | VARCHAR(20) | NO |
| recovered_order_id | BIGINT(20) UNSIGNED | YES |
| abandoned_at | DATETIME | YES |
| recovered_at | DATETIME | YES |
| created_at | DATETIME | NO |
| updated_at | DATETIME | NO |
| name | VARCHAR(255) | NO |
| enabled | TINYINT(1) | NO |
| trigger_delay | INT(11) | NO |
| trigger_unit | VARCHAR(10) | NO |
| template | TEXT | NO |
| rules | LONGTEXT | YES |
| coupon_enabled | TINYINT(1) | NO |
| coupon_type | VARCHAR(20) | YES |
| coupon_amount | DECIMAL(10,2) | YES |
| coupon_validity_hours | INT(11) | YES |
| coupon_auto_apply | TINYINT(1) | NO |
| priority | INT(11) | NO |
| created_at | DATETIME | NO |
| updated_at | DATETIME | NO |
| name | VARCHAR(255) | NO |
| description | TEXT | YES |
| created_at | DATETIME | NO |
| list_id | BIGINT(20) UNSIGNED | NO |
| added_at | DATETIME | NO |
| automation_id | BIGINT(20) UNSIGNED | NO |
| cart_id | BIGINT(20) UNSIGNED | NO |
| message_id | BIGINT(20) UNSIGNED | YES |
| coupon_code | VARCHAR(100) | YES |
| coupon_expires_at | DATETIME | YES |
| status | VARCHAR(20) | NO |
| scheduled_at | DATETIME | NO |
| sent_at | DATETIME | YES |
| created_at | DATETIME | NO |
| name | VARCHAR(255) | NO |
| message | TEXT | NO |
| list_ids | TEXT | NO |
| scheduled_at | DATETIME | YES |
| status | VARCHAR(20) | NO |
| sent_count | INT(11) UNSIGNED | NO |
| failed_count | INT(11) UNSIGNED | NO |
| attachment_id | BIGINT(20) UNSIGNED | YES |
| media_url | VARCHAR(500) | YES |
| media_type | VARCHAR(20) | YES |
| media_filename | VARCHAR(255) | YES |
| created_at | DATETIME | NO |
| updated_at | DATETIME | NO |
| campaign_id | BIGINT(20) UNSIGNED | NO |
| contact_id | BIGINT(20) UNSIGNED | NO |
| phone | VARCHAR(20) | NO |
| status | VARCHAR(20) | NO |
| error_message | TEXT | YES |
| sent_at | DATETIME | YES |
| created_at | DATETIME | NO |
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