/*
create user whepi_test@'%' identified by '123456';
flush privileges;

CREATE DATABASE IF NOT EXISTS whepi_test default charset utf8 COLLATE utf8_general_ci;
grant all privileges on whepi_test.* to whepi_test;
flush privileges;
*/

drop table if exists tb_user
;
create table tb_user
(
  user_id             BIGINT          not null             comment '用户编号',
  login_name          VARCHAR(50)     not null default ''  comment '登录账户',
  login_pwd           VARCHAR(50)     not null default '123456'  comment '登录密码',
  phone               VARCHAR(11)     not null default ''  comment '用户手机号',
  user_type           VARCHAR(1)      not null             comment '角色 A=管理员 / C=收银员 / S=销售',
  staff_name          VARCHAR(20)     not null             comment '用户姓名',
  place_id            BIGINT          not null default 0   comment '场地id',
  version             CHAR(19)        not null             comment 'token版本',
  login_count         INTEGER         not null default '0' comment '登录次数',
  last_login_time     TIMESTAMP NOT NULL COMMENT '最后登录时间',

  be_active           CHAR(1)         not null default 'Y' comment '是否活动 Y=活动/N=禁用/D=删除',
  create_at TIMESTAMP NOT NULL COMMENT '建立时间',
  update_at TIMESTAMP NOT NULL COMMENT '更新日期',
  primary key ( user_id )
)
  ENGINE=InnoDB
  DEFAULT CHARSET=utf8
  COMMENT = '用户资料'
;
