update.sql 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ALTER TABLE `tmrwatch2`.`feedlaid`
  2. ADD COLUMN `status` int(1) NOT NULL DEFAULT 0 COMMENT '0 已出库 \r\n1 未出库 \r\n2 已撤销\r\n' AFTER `pricenew`;
  3. alter table feedtemplet
  4. add updatetime datetime default CURRENT_TIMESTAMP null;
  5. ALTER TABLE `tmrwatch`.`tmr`
  6. ADD COLUMN `lastinorout` int(1) NULL DEFAULT 0 AFTER `autosecondname`
  7. alter table fpdetail
  8. alter column ptuse set default 0;
  9. alter table fpdetail
  10. alter column ptsuse set default 0;
  11. -- 修改饲料表顺序
  12. -- update
  13. -- (SELECT @rownum:=0)r ,feed fn
  14. -- set fn.sort = @rownum := @rownum+1
  15. -- WHERE fn.pastureid = 1647917519
  16. -- ORDER BY fn.sort DESC
  17. -- 宾州筛bug
  18. -- `barid`, `times`, `operatetime` 唯一索引
  19. -- 宾州筛历史记录表
  20. -- CREATE TABLE `pennsieve_history` (
  21. -- `id` bigint(20) NOT NULL AUTO_INCREMENT,
  22. -- `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  23. -- `times` varchar(50) DEFAULT NULL COMMENT '班次',
  24. -- `onerate` decimal(20,2) DEFAULT NULL COMMENT '第一层比例',
  25. -- `oneweight` decimal(20,2) DEFAULT NULL COMMENT '第一层重量',
  26. -- `tworate` decimal(20,2) DEFAULT NULL COMMENT '第二层比列',
  27. -- `twoweight` decimal(20,2) DEFAULT NULL COMMENT '第二层重量',
  28. -- `threerate` decimal(20,2) DEFAULT NULL COMMENT '第三层比列',
  29. -- `threeweight` decimal(20,2) DEFAULT NULL COMMENT '第三层重量',
  30. -- `fourrate` decimal(20,2) DEFAULT NULL COMMENT '第四层比列',
  31. -- `fourweight` decimal(20,2) DEFAULT NULL COMMENT '第四层重量',
  32. -- `operatetime` datetime DEFAULT NULL COMMENT '操作时间',
  33. -- `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  34. -- `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  35. -- `species` varchar(50) DEFAULT NULL COMMENT '种类',
  36. -- PRIMARY KEY (`id`)
  37. -- ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
  38. -- 配方干物质
  39. -- 到体况评分bug
  40. CREATE TABLE `ftdry_history` (
  41. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  42. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  43. `times` varchar(50) DEFAULT NULL COMMENT '班次',
  44. `freshweight` decimal(20,2) DEFAULT NULL COMMENT '新鲜重量',
  45. `dryweight` decimal(20,2) DEFAULT NULL COMMENT '烘干重量',
  46. `thoweight` decimal(20,0) DEFAULT NULL COMMENT '理论干物质',
  47. `actweight` decimal(20,0) DEFAULT NULL COMMENT '实际干物质',
  48. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  49. `changeTime` datetime DEFAULT NULL COMMENT '操作时间',
  50. `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  51. PRIMARY KEY (`id`)
  52. ) ENGINE=InnoDB
  53. CREATE TABLE `dungandbodyhistory` (
  54. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  55. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  56. `standardscore` varchar(50) DEFAULT NULL COMMENT '标准分数',
  57. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  58. `cowsum` varchar(50) DEFAULT NULL COMMENT '牛头数',
  59. `onescore` varchar(50) DEFAULT NULL COMMENT '1',
  60. `twoscore` varchar(50) DEFAULT NULL COMMENT '2',
  61. `threescore` varchar(50) DEFAULT NULL COMMENT '3',
  62. `fourscore` varchar(50) DEFAULT NULL COMMENT '4',
  63. `fivescore` varchar(50) DEFAULT NULL COMMENT '5',
  64. `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  65. `species` varchar(50) DEFAULT NULL COMMENT '种类',
  66. `changetime` datetime DEFAULT NULL COMMENT '操作时间',
  67. `sixscore` varchar(50) DEFAULT NULL COMMENT '6',
  68. `sevenscore` varchar(50) DEFAULT NULL COMMENT '7',
  69. PRIMARY KEY (`id`)
  70. ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
  71. -- 增加牲畜类别其他
  72. INSERT INTO `tmrwatch2`.`dictlist`(`pid`, `label`, `value`, `orderby`) VALUES (17, '其他', '6', 6)