-- dependson: None
-- model: statistic.models.Channel and statistic.models.ChannelSell

-- author: Leaf
-- date: 2015.09.23 16:32:15
-- description: add table statistic_channel and statistic_channelsell

BEGIN;
CREATE TABLE `statistic_channelsell` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `stat_date` date NOT NULL,
    `channel` varchar(64) NOT NULL,
    `platform` varchar(64) NOT NULL,
    `total_orders` integer NOT NULL,
    `total_sum` integer NOT NULL,
    `total_sum_gengmei` integer NOT NULL,
    `paid_orders` integer NOT NULL,
    `paid_sum` integer NOT NULL,
    `paid_sum_gengmei` integer NOT NULL,
    `refund_orders` integer NOT NULL,
    `refund_sum` integer NOT NULL,
    `refund_sum_gengmei` integer NOT NULL,
    `refund_rate` double precision NOT NULL,
    `refund_sum_rate` double precision NOT NULL,
    `refund_gengmei_rate` double precision NOT NULL
)
;

COMMIT;
