wp_afw_sessions

Static

Stores session data for tracking user or visitor state.

Column Definitions

ColumnTypeNullable
🔑idBIGINT UNSIGNEDYES
session_idVARCHAR(64)NO
user_idBIGINT UNSIGNEDYES
contextVARCHAR(20)NO
metadataLONGTEXTYES
started_atDATETIMENO
last_activityDATETIMENO
session_idVARCHAR(36)NO
roleVARCHAR(20)NO
contentLONGTEXTNO
contextVARCHAR(20)NO
tokens_usedINT UNSIGNEDYES
abilities_calledLONGTEXTYES
created_atDATETIMENO
session_idBIGINT UNSIGNEDYES
user_idBIGINT UNSIGNEDNO
abilityVARCHAR(100)NO
input_paramsLONGTEXTYES
resultLONGTEXTYES
statusENUM('success', 'failed', 'pending', 'cancelled')NO
executed_atDATETIMENO
typeENUM('faq', 'policy', 'product_info', 'custom')NO
titleVARCHAR(255)NO
contentLONGTEXTNO
embeddingLONGBLOBYES
metadataLONGTEXTYES
is_activeTINYINT(1)YES
created_atDATETIMENO
updated_atDATETIMENO
overall_scoreINT UNSIGNEDNO
category_scoresLONGTEXTNO
issuesLONGTEXTYES
recommendationsLONGTEXTYES
created_atDATETIMENO
user_idBIGINT UNSIGNEDNO
user_typeVARCHAR(20)NO
action_typeVARCHAR(100)NO
action_categoryVARCHAR(50)NO
descriptionTEXTNO
ability_idVARCHAR(100)YES
parametersLONGTEXTYES
resultLONGTEXTYES
statusVARCHAR(20)NO
ip_addressVARCHAR(100)YES
session_idVARCHAR(64)YES
object_typeVARCHAR(50)YES
object_idBIGINT UNSIGNEDYES
created_atDATETIMENO

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