CREATE TABLE affiliate_action (
   `id` INT AUTO_INCREMENT NOT NULL, 
   `affiliate_id` INT DEFAULT NULL, 
   `user_id` INT DEFAULT NULL, 
   `user_ip` TEXT DEFAULT NULL COLLATE utf8_general_ci, 
   `country_code` VARCHAR(10) NOT NULL COLLATE utf8_general_ci, 
   `commission` DOUBLE PRECISION DEFAULT 0 NOT NULL, 
   `created_at` DATETIME DEFAULT NULL,
    PRIMARY KEY(`id`)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;