wp_afw_sessions
StaticStores session data for tracking user or visitor state.
Column Definitions
| Column | Type | Nullable |
|---|---|---|
| 🔑id | BIGINT UNSIGNED | YES |
| session_id | VARCHAR(64) | NO |
| user_id | BIGINT UNSIGNED | YES |
| context | VARCHAR(20) | NO |
| metadata | LONGTEXT | YES |
| started_at | DATETIME | NO |
| last_activity | DATETIME | NO |
| session_id | VARCHAR(36) | NO |
| role | VARCHAR(20) | NO |
| content | LONGTEXT | NO |
| context | VARCHAR(20) | NO |
| tokens_used | INT UNSIGNED | YES |
| abilities_called | LONGTEXT | YES |
| created_at | DATETIME | NO |
| session_id | BIGINT UNSIGNED | YES |
| user_id | BIGINT UNSIGNED | NO |
| ability | VARCHAR(100) | NO |
| input_params | LONGTEXT | YES |
| result | LONGTEXT | YES |
| status | ENUM('success', 'failed', 'pending', 'cancelled') | NO |
| executed_at | DATETIME | NO |
| type | ENUM('faq', 'policy', 'product_info', 'custom') | NO |
| title | VARCHAR(255) | NO |
| content | LONGTEXT | NO |
| embedding | LONGBLOB | YES |
| metadata | LONGTEXT | YES |
| is_active | TINYINT(1) | YES |
| created_at | DATETIME | NO |
| updated_at | DATETIME | NO |
| overall_score | INT UNSIGNED | NO |
| category_scores | LONGTEXT | NO |
| issues | LONGTEXT | YES |
| recommendations | LONGTEXT | YES |
| created_at | DATETIME | NO |
| user_id | BIGINT UNSIGNED | NO |
| user_type | VARCHAR(20) | NO |
| action_type | VARCHAR(100) | NO |
| action_category | VARCHAR(50) | NO |
| description | TEXT | NO |
| ability_id | VARCHAR(100) | YES |
| parameters | LONGTEXT | YES |
| result | LONGTEXT | YES |
| status | VARCHAR(20) | NO |
| ip_address | VARCHAR(100) | YES |
| session_id | VARCHAR(64) | YES |
| object_type | VARCHAR(50) | YES |
| object_id | BIGINT UNSIGNED | YES |
| created_at | DATETIME | NO |
CREATE TABLE Statement
CREATE TABLE IF NOT EXISTS wp_afw_sessions ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, session_id VARCHAR(64) NOT NULL, user_id BIGINT UNSIGNED DEFAULT NULL, context VARCHAR(20) NOT NULL DEFAULT 'customer', metadata LONGTEXT, started_at DATETIME NOT NULL, last_activity DATETIME NOT NULL, INDEX idx_session_id (session_id), INDEX idx_user (user_id), INDEX idx_context (context) ) {$charset_collate};"; // Messages table. $sql[] = "CREATE TABLE IF NOT EXISTS wp_afw_messages ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, session_id VARCHAR(36) NOT NULL, role VARCHAR(20) NOT NULL, content LONGTEXT NOT NULL, context VARCHAR(20) NOT NULL DEFAULT 'customer', tokens_used INT UNSIGNED DEFAULT 0, abilities_called LONGTEXT, created_at DATETIME NOT NULL, INDEX idx_session (session_id), INDEX idx_created (created_at) ) {$charset_collate};"; // Actions audit log table. $sql[] = "CREATE TABLE IF NOT EXISTS wp_afw_actions ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, session_id BIGINT UNSIGNED DEFAULT NULL, user_id BIGINT UNSIGNED NOT NULL, ability VARCHAR(100) NOT NULL, input_params LONGTEXT, result LONGTEXT, status ENUM('success', 'failed', 'pending', 'cancelled') NOT NULL DEFAULT 'pending', executed_at DATETIME NOT NULL, INDEX idx_user (user_id), INDEX idx_ability (ability), INDEX idx_status (status), INDEX idx_executed (executed_at) ) {$charset_collate};"; // Knowledge base table. $sql[] = "CREATE TABLE IF NOT EXISTS wp_afw_knowledge ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, type ENUM('faq', 'policy', 'product_info', 'custom') NOT NULL DEFAULT 'custom', title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, embedding LONGBLOB, metadata LONGTEXT, is_active TINYINT(1) DEFAULT 1, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX idx_type (type), INDEX idx_active (is_active) ) {$charset_collate};"; // Health snapshots table. $sql[] = "CREATE TABLE IF NOT EXISTS wp_afw_health_snapshots ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, overall_score INT UNSIGNED NOT NULL, category_scores LONGTEXT NOT NULL, issues LONGTEXT, recommendations LONGTEXT, created_at DATETIME NOT NULL, INDEX idx_created (created_at) ) {$charset_collate};"; // Audit log table. $sql[] = "CREATE TABLE IF NOT EXISTS wp_afw_audit_log ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, user_id BIGINT UNSIGNED NOT NULL, user_type VARCHAR(20) NOT NULL DEFAULT 'admin', action_type VARCHAR(100) NOT NULL, action_category VARCHAR(50) NOT NULL, description TEXT NOT NULL, ability_id VARCHAR(100) DEFAULT NULL, parameters LONGTEXT DEFAULT NULL, result LONGTEXT DEFAULT NULL, status VARCHAR(20) NOT NULL DEFAULT 'success', ip_address VARCHAR(100) DEFAULT NULL, session_id VARCHAR(64) DEFAULT NULL, object_type VARCHAR(50) DEFAULT NULL, object_id BIGINT UNSIGNED DEFAULT NULL, created_at DATETIME NOT NULL, INDEX idx_user_id (user_id), INDEX idx_action_type (action_type), INDEX idx_action_category (action_category), INDEX idx_status (status), INDEX idx_created_at (created_at), INDEX idx_object (object_type, object_id) ) {$charset_collate};"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; foreach ( $sql as $query ) { dbDelta( $query );Safe to delete?
If you have uninstalled Assistify for WooCommerce, 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_afw_sessions`;
Run this query using phpMyAdmin, Adminer, or your MySQL client. Back up first.
Other tables from Assistify for WooCommerce