CREATE TABLE IF NOT EXISTS `kb_documents` ( `id` INT AUTO_INCREMENT PRIMARY KEY, `title` VARCHAR(255) NOT NULL, `content` TEXT NOT NULL, `tags` VARCHAR(255), `product_id` INT, `language` VARCHAR(10) NOT NULL DEFAULT 'en', `is_active` BOOLEAN NOT NULL DEFAULT TRUE, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FOREIGN KEY (`product_id`) REFERENCES `products`(`id`) ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;