CREATE TABLE IF NOT EXISTS `zyt_personal_account_cost` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `cost_date` date NOT NULL COMMENT '消耗日期',
  `media_source` varchar(120) NOT NULL DEFAULT '' COMMENT '自媒体来源',
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '账户消耗金额',
  `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  `creator_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '录入人ID',
  `creator_name` varchar(64) NOT NULL DEFAULT '' COMMENT '录入人姓名',
  `updater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后修改人ID',
  `updater_name` varchar(64) NOT NULL DEFAULT '' COMMENT '最后修改人姓名',
  `dept_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '录入时部门ID快照',
  `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  `delete_time` int(11) unsigned DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_creator_date_media` (`creator_id`, `cost_date`, `media_source`, `delete_time`),
  KEY `idx_cost_date` (`cost_date`),
  KEY `idx_creator_id` (`creator_id`),
  KEY `idx_dept_id` (`dept_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人账户消耗录入表';
