数据库变更.txt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 
  2. -------------------- 模块: basic Start --------------------
  3. #用户日志表
  4. CREATE TABLE `ec_b_admin_operate` (
  5. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  6. `creation_time` datetime NOT NULL,
  7. `update_time` datetime NOT NULL,
  8. `msg_id` varchar(255) NOT NULL,
  9. `operate` varchar(255) NOT NULL,
  10. `operate_ip` varchar(255) NOT NULL,
  11. `operate_time` datetime NOT NULL,
  12. `operate_user_id` bigint(20) NOT NULL,
  13. `root_org_id` bigint(20) NOT NULL,
  14. PRIMARY KEY (`id`),
  15. UNIQUE KEY `IDX_R_ADMIN_OPERATE_03` (`msg_id`),
  16. KEY `IDX_R_ADMIN_OPERATE_01` (`root_org_id`,`operate_user_id`),
  17. KEY `IDX_R_ADMIN_OPERATE_02` (`root_org_id`,`operate_user_id`,`operate_time`)
  18. ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
  19. #首次登录改密码
  20. alter table ec_b_user add password_weak bit(1) NOT NULL DEFAULT 1;
  21. update ec_b_user set password_weak=0;
  22. alter table ec_b_student add password_weak bit(1) NOT NULL DEFAULT 1;
  23. update ec_b_student set password_weak=0;
  24. #学生密码加密(可重复执行)
  25. update ec_b_student set password=UPPER(SHA2(CONCAT(identity_number,password),256)) where LENGTH(password)<64;
  26. #后台用户密码加密(可重复执行)
  27. update ec_b_user set password=UPPER(SHA2(CONCAT(login_name,password),256)) where id not in (select f.user_id from ec_b_user_role_relation f where f.role_id=1) and LENGTH(password)<64;
  28. -------------------- 模块: basic End --------------------