-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
drop table if exists sys_user;
create table sys_user
(
  user_id             BIGINT          not null             comment '用户编号',
  weixin_id          VARCHAR(50)     not null default ''  comment '微信ID',
  token               VARCHAR(50)     not null default ''  comment 'token',
  version             CHAR(19)        not null             comment 'token版本',
  create_at TIMESTAMP NOT NULL COMMENT '建立时间',
  update_at TIMESTAMP NOT NULL COMMENT '更新日期',
  primary key ( user_id )
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT = '微信用户关联';

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS sys_user_role;
CREATE TABLE sys_user_role  (
  ur_id 		bigint(20) NOT NULL COMMENT '用户角色关系ID',
  user_id 		bigint(20) NOT NULL COMMENT '用户ID',
  role_id 		int(11) NOT NULL COMMENT '角色ID:1居民,2业委会,3商家',
  user_create 	bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
  time_create 	datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
  user_update 	bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
  time_update 	datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  PRIMARY KEY (ur_id) USING BTREE
) ENGINE = InnoDB default charset=utf8 comment = '用户角色关系表';