v3.0.0.sql 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. SET NAMES utf8;
  2. SET FOREIGN_KEY_CHECKS=0;
  3. CREATE TABLE IF NOT EXISTS `t_customized` (
  4. `customized_id` int(11) NOT NULL AUTO_INCREMENT,
  5. `customized_name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  6. `customized_shortname` varchar(255) COLLATE utf8_bin DEFAULT '',
  7. `customized_title` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  8. `customized_class` varchar(255) COLLATE utf8_bin DEFAULT '',
  9. `customized_content` varchar(255) COLLATE utf8_bin DEFAULT '',
  10. `customized_type` tinyint(1) DEFAULT NULL,
  11. `permission` tinyint(1) DEFAULT 0,
  12. `user_ids` text COLLATE utf8_bin DEFAULT NULL,
  13. `ctime` datetime DEFAULT NULL,
  14. `utime` datetime DEFAULT NULL,
  15. `company_id` int(11) DEFAULT NULL,
  16. `customized_other` text COLLATE utf8_bin DEFAULT NULL,
  17. PRIMARY KEY (`customized_id`)
  18. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  19. -- ----------------------------
  20. -- Table structure for t_fast_input
  21. -- ----------------------------
  22. CREATE TABLE IF NOT EXISTS `t_fast_input` (
  23. `fast_input_id` int(11) NOT NULL AUTO_INCREMENT,
  24. `customized_id` int(11) NOT NULL,
  25. `fast_input_number` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT '',
  26. `fast_input_state` tinyint(1) DEFAULT 0,
  27. `fast_input_data_ids` text COLLATE utf8_bin NOT NULL,
  28. `fast_input_content` text COLLATE utf8_bin DEFAULT NULL,
  29. `ctime` datetime DEFAULT NULL,
  30. `utime` datetime DEFAULT NULL,
  31. `company_id` int(11) DEFAULT NULL,
  32. `user_id` int(11) DEFAULT NULL,
  33. PRIMARY KEY (`fast_input_id`)
  34. ) ENGINE=InnoDB AUTO_INCREMENT=122 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  35. -- ----------------------------
  36. -- Table structure for t_inventory_price_record
  37. -- ----------------------------
  38. CREATE TABLE IF NOT EXISTS `t_inventory_price_record` (
  39. `inventory_price_record_id` int(11) NOT NULL AUTO_INCREMENT,
  40. `inventory_id` int(11) NOT NULL,
  41. `record_time` datetime NOT NULL,
  42. `inventory_price` double(22,2) NOT NULL,
  43. `notes` text DEFAULT NULL,
  44. `status` int(2) DEFAULT 99,
  45. `ctime` datetime DEFAULT NULL,
  46. `utime` datetime DEFAULT NULL,
  47. `user_id` int(11) DEFAULT NULL,
  48. PRIMARY KEY (`inventory_price_record_id`),
  49. KEY `inventory_id` (`inventory_id`),
  50. CONSTRAINT `t_inventory_price_record_ibfk_1` FOREIGN KEY (`inventory_id`) REFERENCES `t_inventory` (`inventory_id`) ON DELETE CASCADE ON UPDATE CASCADE
  51. ) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8;
  52. -- ----------------------------
  53. -- Table structure for t_machine_pause
  54. -- ----------------------------
  55. CREATE TABLE IF NOT EXISTS `t_machine_pause` (
  56. `machine_id` int(11) NOT NULL,
  57. `ctime` datetime DEFAULT NULL,
  58. `utime` datetime DEFAULT NULL,
  59. `user_id` int(11) DEFAULT NULL,
  60. `permission` tinyint(1) DEFAULT 1,
  61. `pause_user_ids` text DEFAULT NULL,
  62. PRIMARY KEY (`machine_id`) USING BTREE
  63. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  64. -- ----------------------------
  65. -- Table structure for t_machine_stop_reason
  66. -- ----------------------------
  67. CREATE TABLE IF NOT EXISTS `t_machine_stop_reason` (
  68. `stop_reason_id` int(11) NOT NULL AUTO_INCREMENT,
  69. `stop_reason_name` varchar(255) NOT NULL,
  70. `ctime` datetime DEFAULT NULL,
  71. `utime` datetime DEFAULT NULL,
  72. `user_id` int(11) DEFAULT NULL,
  73. `permission` tinyint(1) DEFAULT 1,
  74. `stop_reason_user_ids` text DEFAULT NULL,
  75. PRIMARY KEY (`stop_reason_id`) USING BTREE
  76. ) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  77. -- ----------------------------
  78. -- Table structure for t_offer_cost_float
  79. -- ----------------------------
  80. CREATE TABLE IF NOT EXISTS `t_offer_cost_float` (
  81. `offer_cost_float_id` int(11) NOT NULL AUTO_INCREMENT,
  82. `offer_cost_float_number` double(13,2) DEFAULT 0.00,
  83. `product_ids` text DEFAULT NULL,
  84. `ctime` datetime DEFAULT NULL,
  85. `utime` datetime DEFAULT NULL,
  86. `user_id` int(11) DEFAULT NULL,
  87. PRIMARY KEY (`offer_cost_float_id`) USING BTREE
  88. ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  89. -- ----------------------------
  90. -- Table structure for t_offer_price
  91. -- ----------------------------
  92. CREATE TABLE IF NOT EXISTS `t_offer_price` (
  93. `offer_price_id` int(11) NOT NULL AUTO_INCREMENT,
  94. `offer_price_des` varchar(255) NOT NULL,
  95. `offer_price_number` double(13,2) DEFAULT 0.00,
  96. `ctime` datetime DEFAULT NULL,
  97. `utime` datetime DEFAULT NULL,
  98. `user_id` int(11) DEFAULT NULL,
  99. `permission` tinyint(1) DEFAULT 1,
  100. `see_user_ids` text DEFAULT NULL,
  101. PRIMARY KEY (`offer_price_id`) USING BTREE
  102. ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  103. -- ----------------------------
  104. -- Table structure for t_user_report_password
  105. -- ----------------------------
  106. CREATE TABLE IF NOT EXISTS `t_user_report_password` (
  107. `user_id` int(11) NOT NULL,
  108. `report_password` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  109. `report_password_type` tinyint(1) NOT NULL DEFAULT 0,
  110. `report_password_interval` int(11) DEFAULT 0,
  111. `use_time` datetime DEFAULT NULL,
  112. `ctime` datetime DEFAULT NULL,
  113. PRIMARY KEY (`user_id`) USING BTREE,
  114. CONSTRAINT `t_user_report_password_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  115. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  116. ALTER TABLE `t_machine_calculation`
  117. ADD COLUMN IF NOT EXISTS `stop_reason_id` int(11) NULL AFTER `public_note`;
  118. ALTER TABLE `t_machine`
  119. ADD COLUMN IF NOT EXISTS `pause_affair_data_id` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' AFTER `affair_data_id`;
  120. ALTER TABLE `t_rule_new`
  121. ADD COLUMN IF NOT EXISTS `machine_modular_pause` tinyint(1) NULL DEFAULT 0 AFTER `machine_modular_wait`;
  122. ALTER TABLE `t_rule_new`
  123. ADD COLUMN IF NOT EXISTS `product_modular_internal_price` tinyint(1) NULL DEFAULT 0 AFTER `documentary_modular_remove`,
  124. ADD COLUMN IF NOT EXISTS `product_cost_accounting` tinyint(1) NULL DEFAULT 0 AFTER `product_modular_internal_price`,
  125. ADD COLUMN IF NOT EXISTS `product_cost_view` tinyint(1) NULL DEFAULT 0 AFTER `product_cost_accounting`;
  126. ALTER TABLE `t_inventory_calculation`
  127. ADD COLUMN IF NOT EXISTS `offer_price` decimal(22,3) NULL DEFAULT -1 AFTER `from_data_id`,
  128. ADD COLUMN IF NOT EXISTS `offer_product_total_cost` decimal(22,6) NULL AFTER `offer_price`,
  129. ADD COLUMN IF NOT EXISTS `calculation_ctime` datetime NULL DEFAULT NULL AFTER `offer_product_total_cost`;
  130. ALTER TABLE `t_inventory`
  131. ADD COLUMN IF NOT EXISTS `inventory_price_unit` tinyint(1) NULL AFTER `utime`;
  132. ALTER TABLE `t_statement_calculation`
  133. ADD COLUMN IF NOT EXISTS `bill_ids` text NULL AFTER `tag_numbers`;
  134. ALTER TABLE `t_tag_list_rel`
  135. ADD COLUMN IF NOT EXISTS `ctime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP AFTER `tag_id`;
  136. REPLACE INTO `t_affair_system_column`(`column_id`, `column_pid`, `group_id`, `column_order`, `column_title`, `column_name`, `column_unit`, `column_type`, `column_control`, `column_rule`, `column_is_virtual`, `column_unit_symbiosis`, `column_detachable`, `status`) VALUES (238, 0, 9, 9, '胚布价格', 'public_embryo_price', '[{\"key\":\"yuan/kg\",\"value\":\"元/公斤\"},{\"key\":\"yuan/yard\",\"value\":\"元/码\"},{\"key\":\"yuan/one\",\"value\":\"元/条\"},{\"key\":\"yuan/m\",\"value\":\"元/米\"},{\"key\":\"yuan/slice\",\"value\":\"元/片\"}]', '{\"key\":\"double\",\"value\":\"3\"}', 0, '{\"regex\":\"/^[0-9]+(.[0-9]{0,3})?$/\",\"tips\":\"只能为数字和3位小数点\"}', 0, '', 2, NULL);
  137. REPLACE INTO `t_affair_system_column`(`column_id`, `column_pid`, `group_id`, `column_order`, `column_title`, `column_name`, `column_unit`, `column_type`, `column_control`, `column_rule`, `column_is_virtual`, `column_unit_symbiosis`, `column_detachable`, `status`) VALUES (338, 0, 6, 10, '同步数量', 'synchronous_quantity', '[{\"key\":\"kg\",\"value\":\"公斤\"},{\"key\":\"yard\",\"value\":\"码\"},{\"key\":\"kg/yard\",\"value\":\"公斤/码\"},{\"key\":\"one\",\"value\":\"条\"},{\"key\":\"m\",\"value\":\"米\"},{\"key\":\"slice\",\"value\":\"片\"}]', '', 13, '{\"regex\":\"\",\"tips\":\"[公斤/码]时应如5.11/6.22\"}', 0, '', 1, NULL);
  138. ALTER TABLE `t_rule_new`
  139. ADD COLUMN IF NOT EXISTS `image_search` tinyint(1) NULL DEFAULT 0 AFTER `inventory_modular_edit`;
  140. SET FOREIGN_KEY_CHECKS=1;