在mac環(huán)境下使用的數(shù)據(jù)庫連接軟件:Sequel Pro.
mysql數(shù)據(jù)庫默認(rèn)的編碼:utf8;
InnoDB:支持事務(wù)候址,行級鎖吕粹;寫的性能好
MYISAM:支持表級鎖,讀的性能高岗仑;
use o2o;
create table 'tb_area'(
'area_id' int(2) NOT NULL AUTO_INCREMNET,
'area_name' varchar(200) NOT NULL,
'privority' int(2) NOT NULL DEFAULT '0',
'create_time' datetime DEFAULT NULL,
'last_edit_time' datetime DEFAULT NULL,
primary key ('area_id'),
unique key 'UK_AREA'('area_name'),
)ENGINE=InnoDB AUTO_INCREAMENT=1 DEFALUT CHARSET=utf8;
use o2o;
create table 'tb_wechat_auth'(
'wechat_auth_id' int(10) NOT NULL AUTO_INCREMENT,
'user_id' int(10) NOT NULL,
'open_id' varchar(1024) NOT NULL,
'create_time' datetime DEFAULT NULL,
primary key('wechat_auth_id'),
constraint 'fk_wechatauth_profile' foreign key('user_id') references 'tb_person_info'('user_id')
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
增加唯一索引
alter table tb_wechat_auth add unique index(open_id);
頭條實體類
店鋪類別
public class ShopCategory{
private Long shopCategoryId;
private String shopCategoryName;
private String shopCategoryDesc;
private String shopCategoryImg;
private Integer priority;
private Date createTime;
private Date lastEditTime;
private ShopCategory parent;
}