首页 > 代码库 > EDM程序 MYsql数据库设计
EDM程序 MYsql数据库设计
\\客户属性
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment COMMENT ‘编号‘,
`name` varchar(255) default NULL COMMENT ‘客户姓名‘,
`age` int(3) COMMENT default NULL ‘年龄‘,
`gender` int(2) default ‘0‘ COMMENT ‘性别:0男1女,默认为零‘,
`birthday` datetime default NULL COMMENT ‘生日‘,
`mobile` varchar(255) default NULL COMMENT ‘移动电话‘,
`email` varchar(255) default NULL NOT NULL COMMENT ‘电子邮件‘,
`ip` varchar(255) default NULL COMMENT ‘ip‘,
`address` varchar(255) default NULL COMMENT ‘地址‘,
`source` varchar(255) default NULL COMMENT ‘来源‘,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
\\发送统计
CREATE TABLE `sendcount` (
`id` int(11) NOT NULL auto_increment COMMENT ‘编号‘,
`sendtime` varchar(255) default NULL COMMENT ‘发送时间‘,
`active_id` int(5) default NULL COMMENT ‘活动ID‘,
`customer_id` int(5) default NULL COMMENT ‘客户ID‘,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
\\ 活动表
CREATE TABLE `doings` (
`id` int(11) NOT NULL auto_increment COMMENT ‘编号‘,
`projectid` int(5) default NULL COMMENT ‘项目ID‘,
`typeid` int(5) default NULL COMMENT ‘类型ID‘,
`senddate` datetime default NULL COMMENT ‘发送日期‘,
`againdate` datetime default NULL COMMENT ‘解禁日期‘,
`area` varchar(50) default NULL COMMENT ‘适用区域‘,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
\\开信点击活动关联表
CREATE TABLE `openemail_clickdoing` (
`id` int(11) NOT NULL auto_increment COMMENT ‘编号‘,
`open_id` int(5) default NULL COMMENT ‘开信ID‘,
`click_id` int(5) default NULL COMMENT ‘点击ID‘,
`active_id` int(5) default NULL COMMENT ‘活动ID‘,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
\\记录跳转
CREATE TABLE `recordjump` (
`id` int(11) NOT NULL auto_increment COMMENT ‘关联表id‘,
`jump_url` varchar(255) default NULL COMMENT ‘记录跳转‘,
`active_id` int(5) default NULL COMMENT ‘活动ID‘,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
\\开信统计
CREATE TABLE `openmailcount` (
`id` int(11) NOT NULL auto_increment COMMENT ‘关联表id‘,
`ip` varchar(255) COMMENT ‘ip‘,
`open_time` varchar(255) default NULL COMMENT ‘开信时间‘,
`open_code` varchar(255) default NULL COMMENT ‘开信地址‘,
`open_email` varchar(255) default NULL COMMENT ‘开信email‘,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
\\ 点击统计
CREATE TABLE `clickcount` (
`id` int(11) NOT NULL auto_increment COMMENT ‘关联表id‘,
`click_time` varchar(255) default NULL COMMENT ‘点击时间‘,
`click_code` varchar(255) default NULL COMMENT ‘点击地址‘,
`click_email` varchar(255) default NULL COMMENT ‘点击email‘,
`ip` varchar(255) COMMENT ‘ip‘,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
EDM程序 MYsql数据库设计