-- Migration: Customer Feedback
-- Run this SQL on your database.

CREATE TABLE IF NOT EXISTS `customer_feedbacks` (
    `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `store_id` INT UNSIGNED NOT NULL,
    `transaction_id` INT UNSIGNED DEFAULT NULL,
    `rating` TINYINT UNSIGNED NOT NULL COMMENT '1=bad, 2=neutral, 3=good',
    `feedback_text` VARCHAR(500) DEFAULT NULL,
    `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX `idx_cf_store` (`store_id`),
    INDEX `idx_cf_date` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
