1,電視台表結構,包括推送的三張表
create database tv;
use tv;
create table t_user(
id int(10) auto_increment primary key,
username varchar(50),
password varchar(50),
nickname varchar(20),
create_id int(10) unsigned,
create_time bigint(10) unsigned,
update_time bigint(10) unsigned,
status int(2) unsigned default 1,
email varchar(50),
potrait varchar(50),
level int(2) unsigned default 0,
reserved varchar(250)
);
create table t_admin(
id int(10) unsigned auto_increment primary key,
status int(2) unsigned,
lastlogintime bigint(10) unsigned,
loginip varchar(30),
type smallint(1) unsigned,
create table t_admin_operation_log(
scriptname varchar(50),
url varchar(200),
optime int(10) unsigned
create table t_user_log(
userid int(10) unsigned,
login_time int(10) unsigned,
login_result int(10) unsigned,
cause varchar(250),
user_agent varchar(250),
ip varchar(250),
create table t_news(
type int(5) unsigned,
title varchar(250),
pic varchar(250),
content longtext,
keyword varchar(250),
releaseid int(10) unsigned,
release_time bigint(10) unsigned,
deleteid int(10) unsigned,
delete_time bigint(10) unsigned,
sticktop int(2) unsigned,
create table t_comment(
from_userid int(10) unsigned,
from_username varchar(50),
comments longtext,
target_type int(2) unsigned,
targetid int(10) unsigned,
create table t_business_information(
link varchar(250),
from_websit varchar(250),
create table t_video(
column_type int(5) unsigned default 0,
url varchar(250),
path varchar(250),
videoformat varchar(250),
type int(2) unsigned,
create table t_notice(
create table t_bbs(
cardcontent longtext,
click int(10) unsigned,
release_name varchar(50),
create table t_user_sendcard(
followcardcontent text ,
cardid int(10) unsigned,
card_type int(2) unsigned,
create table t_sendauditing(
sendcardid int(10) unsigned,
auditingstatus int(2) unsigned,
compositor int(2) unsigned
create table t_tip_off(
content varchar(250),
create table t_dictionary(
groupid varchar(250),
key2 varchar(250),
value varchar(250),
description varchar(250)
create table t_investigation(
exam_name varchar(250),
exam_time int(10) unsigned,
score int(10) unsigned,
create table t_questioncontent(
tittle varchar(255),
pic varchar(255),
option_length int(5) unsigned,
option_a varchar(255),
option_b varchar(255),
option_c varchar(255),
option_d varchar(255),
option_e varchar(255),
right_answer varchar(255),
right_multianser varchar(255),
create table t_question(
description varchar(255),
question_type int(5) unsigned,
single_score int(5) unsigned,
questioncontentid int(10) unsigned
create table t_questionresult(
result_answer varchar(255),
resultmultianser varchar(255),
resultstate int(1) unsigned,
questionid int(10) unsigned,
investigationid int(10) unsigned
create table t_user_feedback(
/* 裝置系統資料庫*/
create table t_push_device(
`id` int(10) unsigned not null auto_increment comment 'id',
userid int(10) unsigned unique null comment '使用者資料庫id',
device_id varchar(50) unique not null comment '裝置唯一辨別',
device_register_time varchar(50) comment '裝置注冊時間',
os_type varchar(10) comment '裝置作業系統類型android or ios',
os_version varchar(10) comment '裝置作業系統版本,例如4.3.1,8.3',
reserved varchar(250) comment '預留資訊,暫時沒有用',
device_info varchar(255) comment '移動裝置的其他資訊,比如uuid,mac位址,手機型号等',
primary key (`id`)
/* 推送消息表 */
create table t_push_message(
to_userid int(10) unsigned,
to_username varchar(50) null comment '使用者郵箱,滿足唯一性',
push_title varchar(250) comment '推送消息标題',
push_content varchar(250) comment '推送消息内容',
push_time varchar(50) comment '推送日期,格式:yyyy-mm-dd hh:mm:ss',
bulk_or_point varchar(10) comment '是否是定點推送,取值bulk,point',
fromuid int(10) unsigned,
-- 使用者通路日志
create table t_access_log(
os_type varchar(10) comment '裝置類型android or ios',
device_id varchar(50) comment '裝置标示(device token or clientid)',
access_day varchar(50),
requesturi varchar(50),
userid int(10) unsigned comment '登入使用者的資料庫id',
username varchar(50) comment '登入使用者',
time bigint(10) unsigned,
ip varchar(50) comment '内網ip',
extranet_ip varchar(50) comment '外網ip',
description varchar(50),
access_type smallint(1) unsigned,
--壓縮圖檔失敗的日志
create table t_compress_failed_pic (
id integer not null auto_increment, cause varchar(255),
failed_time datetime comment '失敗的時間',
original_size bigint comment '圖檔原始大小',
pic_path varchar(255),
primary key (id)
)
-- 簡單的消息,沒有釋出者
create table t_simple_info (
id integer not null auto_increment,
create_time bigint, info longtext,
status integer not null comment '1:可用;2:不可用',
alter table t_push_device add index fk_4e4qn4vp4du6e5okbn0dq3wdf (userid), add constraint fk_4e4qn4vp4du6e5okbn0dq3wdf foreign key (userid) references t_user (id)
--接收到的推送消息
create table t_received_push_message (
fromuid integer,
push_content varchar(255),
push_title varchar(255),
received_time varchar(255),
reserved varchar(255),
to_userid integer,
)
alter table t_push_message add index fk_ek2r577b6r0i1r49qsh724wnl (to_userid), add constraint fk_ek2r577b6r0i1r49qsh724wnl foreign key (to_userid) references t_user (id)
alter table t_received_push_message add index fk_1id8pc8ubfv8dg4k1sq8o4fxr (to_userid), add constraint fk_1id8pc8ubfv8dg4k1sq8o4fxr foreign key (to_userid) references t_user (id)