account-schema.sql 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. create table if not exists `ac_account`
  2. (
  3. id bigint unsigned primary key not null,
  4. realname varchar(100) comment '姓名',
  5. mobile varchar(30) comment '手机号',
  6. email varchar(100) comment '邮箱',
  7. avatar_url varchar(300) comment '头像',
  8. sex int default 0 comment '性别'
  9. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='个人账户';
  10. create table if not exists `ac_company`
  11. (
  12. id bigint unsigned primary key not null,
  13. name varchar(300) comment '名称',
  14. secret_key varchar(64) comment '私钥'
  15. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司';
  16. create table if not exists `ac_account_company`
  17. (
  18. account_id bigint unsigned comment '账户ID',
  19. company_id bigint unsigned comment '公司ID'
  20. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司账户绑定';
  21. create table if not exists `ac_device_info`
  22. (
  23. account_id bigint unsigned comment '账户ID',
  24. version varchar(20) comment '客户端发行版本,例如1.0.0',
  25. model varchar(30) comment '设备型号',
  26. os int comment '系统',
  27. os_version varchar(20) comment '系统版本,例如7.1',
  28. longitude double comment '经度',
  29. latitude double comment '纬度',
  30. location varchar(300) comment '位置',
  31. lang varchar(10) comment '语言',
  32. login_time datetime comment '登录时间',
  33. channel_id varchar(100) comment '消息通道ID'
  34. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备信息';
  35. create table if not exists `ac_login_log`
  36. (
  37. id bigint unsigned primary key not null auto_increment,
  38. account_id bigint unsigned comment '账户ID',
  39. version varchar(20) comment '客户端发行版本,例如1.0.0',
  40. model varchar(30) comment '设备型号',
  41. os int comment '系统',
  42. os_version varchar(20) comment '系统版本,例如7.1',
  43. longitude double comment '经度',
  44. latitude double comment '纬度',
  45. location varchar(300) comment '位置',
  46. lang varchar(10) comment '语言',
  47. login_time datetime comment '登录时间',
  48. logon bool comment '登录是否成功',
  49. login_error varchar(1000) comment '登录失败错误信息'
  50. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备信息';