Files
baijiahao_text_to_image/db/split_tables/ai_statistics_days.sql

26 lines
1.9 KiB
MySQL
Raw Normal View History

-- SQL table definition
-- Generated from splitting a larger SQL file
-- Table: ai_statistics_days
--
CREATE TABLE `ai_statistics_days` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`author_id` int NOT NULL DEFAULT '0' COMMENT '作者ID',
`author_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '作者名称',
`channel` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=baidu|2=toutiao|3=weixin',
`stat_date` date NOT NULL COMMENT '统计日期(自然日)',
`daily_published_count` int DEFAULT '0' COMMENT '单日发文量',
`day_revenue` decimal(18,2) DEFAULT '0.00' COMMENT '当天收益stat_date所在自然日',
`cumulative_published_count` int DEFAULT '0' COMMENT '累计发文量从起始日到stat_date的总和',
`monthly_revenue` decimal(18,2) DEFAULT '0.00' COMMENT '当月收益stat_date所在自然月的总收益',
`weekly_revenue` decimal(18,2) DEFAULT '0.00' COMMENT '当周收益stat_date所在自然周的总收益周一至周日',
`revenue_mom_growth_rate` decimal(10,6) DEFAULT '0.000000' COMMENT '收益月环比增长率((本月收益 - 上月收益) / NULLIF(上月收益, 0)',
`revenue_wow_growth_rate` decimal(10,6) DEFAULT '0.000000' COMMENT '收益周环比增长率((本周收益 - 上周收益) / NULLIF(上周收益, 0)',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_stat_date` (`stat_date`,`author_id`) USING BTREE,
KEY `idx_stat_date` (`stat_date`) USING BTREE,
KEY `idx_author_id` (`author_id`)
) ENGINE=InnoDB AUTO_INCREMENT=98484 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='AI内容每日核心指标汇总表含累计、收益及环比';