USE goviensh_grow;

CREATE TABLE IF NOT EXISTS user_rewards (
    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    user_id INT UNSIGNED NOT NULL,
    title VARCHAR(150) NOT NULL,
    amount DECIMAL(10,2) NOT NULL DEFAULT 0,
    status ENUM('claimable','claimed','cancelled') NOT NULL DEFAULT 'claimable',
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    claimed_at DATETIME NULL,
    admin_remark VARCHAR(255) DEFAULT NULL,
    CONSTRAINT fk_user_rewards_user
        FOREIGN KEY (user_id) REFERENCES users(id)
        ON DELETE CASCADE
) ENGINE=InnoDB;