CREATE TABLE `affiliate_stats` ( `id` int(11) NOT NULL, `affiliate_user_id` int(11) NOT NULL, `no_of_click` int(11) NOT NULL DEFAULT 0, `no_of_order_item` int(11) NOT NULL DEFAULT 0, `no_of_delivered` int(11) NOT NULL DEFAULT 0, `no_of_cancel` int(11) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `affiliate_stats` ADD PRIMARY KEY (`id`); ALTER TABLE `affiliate_stats` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT;