/*
 Navicat Premium Dump SQL

 Source Server         : 192.168.1.82
 Source Server Type    : PostgreSQL
 Source Server Version : 160003 (160003)
 Source Host           : 192.168.1.82:5432
 Source Catalog        : themetis_app
 Source Schema         : themetis_scp

 Target Server Type    : PostgreSQL
 Target Server Version : 160003 (160003)
 File Encoding         : 65001

 Date: 15/11/2025 12:44:20
*/


-- ----------------------------
-- Table structure for hx_scp_bom_lock
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."hx_scp_bom_lock";
CREATE TABLE "themetis_scp"."hx_scp_bom_lock" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".hx_scp_bom_lock_id_seq'::regclass),
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "channel" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "bom_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "week_times" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "lock_quantity" numeric(20,6) NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."supply_unit_code" IS '工厂';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."demand_unit_code" IS '一级市场';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."channel" IS '渠道';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."product_category_code" IS '销售型号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."bom_no" IS 'BOM号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."week_times" IS '周次';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."lock_quantity" IS '锁定量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_bom_lock"."workbench_code" IS '工作台代码，外键';
COMMENT ON TABLE "themetis_scp"."hx_scp_bom_lock" IS '锁定BOM';

-- ----------------------------
-- Table structure for hx_scp_box_transfer_quantity
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."hx_scp_box_transfer_quantity";
CREATE TABLE "themetis_scp"."hx_scp_box_transfer_quantity" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".hx_scp_box_transfer_quantity_id_seq'::regclass),
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "box_body" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "door_body" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "target_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "required_month" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "required_quantity" numeric(20,6) NOT NULL,
  "plan_adjusting_quantity" numeric(20,6),
  "actual_adjusting_quantity" numeric(20,6),
  "transfer_status" varchar(30) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."box_body" IS '箱体';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."door_body" IS '门体';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."supply_unit_code" IS '转出工厂';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."target_unit_code" IS '转入工厂';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."required_month" IS '需求月份';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."required_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."plan_adjusting_quantity" IS '计划调整量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."actual_adjusting_quantity" IS '实际调整量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."transfer_status" IS '转移状态';
COMMENT ON COLUMN "themetis_scp"."hx_scp_box_transfer_quantity"."workbench_code" IS '工作台代码，外键';
COMMENT ON TABLE "themetis_scp"."hx_scp_box_transfer_quantity" IS '分工厂箱体转移量';

-- ----------------------------
-- Table structure for hx_scp_ord_deliv_result
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."hx_scp_ord_deliv_result";
CREATE TABLE "themetis_scp"."hx_scp_ord_deliv_result" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".hx_scp_ord_deliv_result_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_line_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_type" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "line_status" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "marketing_feedback_status" varchar(100) COLLATE "pg_catalog"."default",
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "sales_sub_company" varchar(200) COLLATE "pg_catalog"."default",
  "product_company" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "product_model_manufacture" varchar(40) COLLATE "pg_catalog"."default",
  "product_model_sales" varchar(40) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "order_quantity" numeric(20,6) NOT NULL,
  "demand_week" varchar(40) COLLATE "pg_catalog"."default",
  "order_priority" int8,
  "required_delivery_date" timestamp(6) NOT NULL,
  "final_committed_qty" numeric(20,6),
  "final_committed_date" timestamp(6),
  "is_unplanned" varchar(10) COLLATE "pg_catalog"."default",
  "initial_committed_qty" numeric(20,6),
  "initial_committed_date" timestamp(6),
  "allowed_delivery_delay_days" numeric(6,2),
  "est_completion_qty" numeric(20,6),
  "est_end_date" timestamp(6),
  "feedback_status" varchar(40) COLLATE "pg_catalog"."default",
  "feedback_message" varchar(1000) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."order_no" IS '订单号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."order_line_no" IS '订单行号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."order_type" IS '订单类型';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."line_status" IS '行状态';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."marketing_feedback_status" IS '营销反馈状态';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."demand_unit_code" IS '市场';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."sales_sub_company" IS '分公司';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."product_company" IS '产品公司';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."supply_unit_code" IS '工厂';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."product_model_manufacture" IS '产品型号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."product_model_sales" IS '销售型号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."material" IS '物料编码';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."order_quantity" IS '订单数量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."demand_week" IS '需求周';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."order_priority" IS '订单优先级';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."required_delivery_date" IS '需求交付时间CRD';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."final_committed_qty" IS '最终承诺出货数量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."final_committed_date" IS '最终承诺出货时间';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."is_unplanned" IS '是否计划外';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."initial_committed_qty" IS '首次承诺出货数量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."initial_committed_date" IS '首次承诺出货时间ETD';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."allowed_delivery_delay_days" IS '需求延期交付容忍天数';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."est_completion_qty" IS '预计完工数量';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."est_end_date" IS '预计完工时间';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."feedback_status" IS '反馈状态';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."feedback_message" IS '反馈消息';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."hx_scp_ord_deliv_result"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."hx_scp_ord_deliv_result" IS '订单交期反馈结果表';

-- ----------------------------
-- Table structure for scp_approval_flow_instance_node
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_approval_flow_instance_node";
CREATE TABLE "themetis_scp"."scp_approval_flow_instance_node" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_approval_flow_instance_node_id_seq'::regclass),
  "approval_instance_id" int8,
  "approval_order_id" int8,
  "approver" varchar(100) COLLATE "pg_catalog"."default",
  "approval_result" varchar(100) COLLATE "pg_catalog"."default",
  "approval_note" varchar(500) COLLATE "pg_catalog"."default",
  "approval_date" timestamp(6),
  "from_node_id" int8,
  "to_node_id" int8,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "approval_task_no" varchar(100) COLLATE "pg_catalog"."default",
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "applicant" varchar(100) COLLATE "pg_catalog"."default",
  "approval_task_item_id" varchar(10000) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."id" IS '自增长序号';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approval_order_id" IS '审批单据ID';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approver" IS '审批人';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approval_result" IS '审批结果(0-拒绝，1-批准，2-转审)';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approval_note" IS '审批意见';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approval_date" IS '审批时间';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."from_node_id" IS '审批节点';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."to_node_id" IS '下一节点';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approval_task_no" IS '审批任务编码';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."workbench_code" IS '工作台编码';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."applicant" IS '申请人';
COMMENT ON COLUMN "themetis_scp"."scp_approval_flow_instance_node"."approval_task_item_id" IS '审批任务对应的数据对象ID,多个ID用英文逗号隔开；后续可能要优化成建任务编码和对象的关系表';
COMMENT ON TABLE "themetis_scp"."scp_approval_flow_instance_node" IS '审批单据实例节点表';

-- ----------------------------
-- Table structure for scp_approval_log
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_approval_log";
CREATE TABLE "themetis_scp"."scp_approval_log" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_approval_log_id_seq'::regclass),
  "approval_flow_code" varchar(100) COLLATE "pg_catalog"."default",
  "approval_rule" varchar(20) COLLATE "pg_catalog"."default",
  "approval_node_num" int4,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "planning_item_id" int8,
  "approval_node_id" varchar(100) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "current_approval_node_flag" bool DEFAULT false,
  "approver_id" varchar(32) COLLATE "pg_catalog"."default",
  "approval_time" timestamp(6),
  "approval_status" varchar(20) COLLATE "pg_catalog"."default",
  "approval_comment" varchar(200) COLLATE "pg_catalog"."default",
  "approval_task_no" varchar(100) COLLATE "pg_catalog"."default",
  "log_time" timestamp(6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."id" IS '自增长ID';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_flow_code" IS '审批流代码';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_rule" IS '单审/或签/会签';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_node_num" IS '审批节点序号';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."workbench_code" IS '工作台编码';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."planning_item_id" IS '工作台计划对象ID';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_node_id" IS '审批节点';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."current_approval_node_flag" IS '当前审批节点标识';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approver_id" IS '审批人账号ID';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_time" IS '审批时间';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_status" IS '审批状态(In Approval Process审批中,Approve通过,Reject驳回,End结束)';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_comment" IS '审批意见';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."approval_task_no" IS '审批任务编码(存储外围系统返回的审批任务编号，如企业微信)';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."log_time" IS '记录时间(用于分区)';
COMMENT ON COLUMN "themetis_scp"."scp_approval_log"."tenant_id" IS '租户ID,UK';
COMMENT ON TABLE "themetis_scp"."scp_approval_log" IS '审批日志';

-- ----------------------------
-- Table structure for scp_atp_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_atp_bucket_data";
CREATE TABLE "themetis_scp"."scp_atp_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_atp_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_atp_bucket_data" IS '供应能力计划数据';

-- ----------------------------
-- Table structure for scp_atp_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_atp_planning_item";
CREATE TABLE "themetis_scp"."scp_atp_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_atp_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."demand_unit_code" IS '需求计划单元（市场）';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr02" IS '分公司';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr03" IS '国家';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr04" IS '客户名称';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr05" IS '滚动计划号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr06" IS '品牌';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr07" IS '整机工厂编码';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr08" IS '整机工厂名称';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr09" IS '出口包装方式';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr10" IS '产品型号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr11" IS '产品规格属性';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."meta_attr12" IS '大区';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_atp_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_atp_planning_item" IS '供应能力计划对象数据';

-- ----------------------------
-- Table structure for scp_attachment_list
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_attachment_list";
CREATE TABLE "themetis_scp"."scp_attachment_list" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_attachment_list_id_seq'::regclass),
  "tenant_id" int8 NOT NULL,
  "attachment_id" int8 NOT NULL,
  "attachment_name" varchar(1000) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "attachment_size_bytes" int8,
  "attachment_url" varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "created_by" int8,
  "creation_date" timestamp(6) NOT NULL,
  "last_updated_by" int8,
  "last_update_date" timestamp(6) NOT NULL,
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."id" IS '主键';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."attachment_id" IS '算法生成全局唯一id,非表唯一键';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."attachment_name" IS '附件名称,UK';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."attachment_size_bytes" IS '附件大小（bytes)';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."attachment_url" IS '附件路径';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."created_by" IS '创建人';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."creation_date" IS '创建时间';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."last_updated_by" IS '更新人';
COMMENT ON COLUMN "themetis_scp"."scp_attachment_list"."last_update_date" IS '更新时间';

-- ----------------------------
-- Table structure for scp_capacity_allocation_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_capacity_allocation_bucket_data";
CREATE TABLE "themetis_scp"."scp_capacity_allocation_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_capacity_allocation_bucket_data_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar COLLATE "pg_catalog"."default",
  "operation_code" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "figure_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_code" varchar COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar COLLATE "pg_catalog"."default",
  "source_period_code" varchar COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric,
  "bk_qty_002" numeric,
  "bk_qty_003" numeric,
  "bk_qty_004" numeric,
  "bk_qty_005" numeric,
  "bk_qty_006" numeric,
  "bk_qty_007" numeric,
  "bk_qty_008" numeric,
  "bk_qty_009" numeric,
  "bk_qty_010" numeric,
  "bk_qty_011" numeric,
  "bk_qty_012" numeric,
  "bk_qty_013" numeric,
  "bk_qty_014" numeric,
  "bk_qty_015" numeric,
  "bk_qty_016" numeric,
  "bk_qty_017" numeric,
  "bk_qty_018" numeric,
  "bk_qty_019" numeric,
  "bk_qty_020" numeric,
  "bk_qty_021" numeric,
  "bk_qty_022" numeric,
  "bk_qty_023" numeric,
  "bk_qty_024" numeric,
  "bk_qty_025" numeric,
  "bk_qty_026" numeric,
  "bk_qty_027" numeric,
  "bk_qty_028" numeric,
  "bk_qty_029" numeric,
  "bk_qty_030" numeric,
  "bk_qty_031" numeric,
  "bk_qty_032" numeric,
  "bk_qty_033" numeric,
  "bk_qty_034" numeric,
  "bk_qty_035" numeric,
  "bk_qty_036" numeric,
  "bk_qty_037" numeric,
  "bk_qty_038" numeric,
  "bk_qty_039" numeric,
  "bk_qty_040" numeric,
  "bk_qty_041" numeric,
  "bk_qty_042" numeric,
  "bk_qty_043" numeric,
  "bk_qty_044" numeric,
  "bk_qty_045" numeric,
  "bk_qty_046" numeric,
  "bk_qty_047" numeric,
  "bk_qty_048" numeric,
  "bk_qty_049" numeric,
  "bk_qty_050" numeric,
  "bk_qty_051" numeric,
  "bk_qty_052" numeric,
  "bk_qty_053" numeric,
  "bk_qty_054" numeric,
  "bk_qty_055" numeric,
  "bk_qty_056" numeric,
  "bk_qty_057" numeric,
  "bk_qty_058" numeric,
  "bk_qty_059" numeric,
  "bk_qty_060" numeric,
  "bk_qty_061" numeric,
  "bk_qty_062" numeric,
  "bk_qty_063" numeric,
  "bk_qty_064" numeric,
  "bk_qty_065" numeric,
  "bk_qty_066" numeric,
  "bk_qty_067" numeric,
  "bk_qty_068" numeric,
  "bk_qty_069" numeric,
  "bk_qty_070" numeric,
  "bk_qty_071" numeric,
  "bk_qty_072" numeric,
  "bk_qty_073" numeric,
  "bk_qty_074" numeric,
  "bk_qty_075" numeric,
  "bk_qty_076" numeric,
  "bk_qty_077" numeric,
  "bk_qty_078" numeric,
  "bk_qty_079" numeric,
  "bk_qty_080" numeric,
  "bk_qty_081" numeric,
  "bk_qty_082" numeric,
  "bk_qty_083" numeric,
  "bk_qty_084" numeric,
  "bk_qty_085" numeric,
  "bk_qty_086" numeric,
  "bk_qty_087" numeric,
  "bk_qty_088" numeric,
  "bk_qty_089" numeric,
  "bk_qty_090" numeric,
  "bk_qty_091" numeric,
  "bk_qty_092" numeric,
  "bk_qty_093" numeric,
  "bk_qty_094" numeric,
  "bk_qty_095" numeric,
  "bk_qty_096" numeric,
  "bk_qty_097" numeric,
  "bk_qty_098" numeric,
  "bk_qty_099" numeric,
  "bk_qty_100" numeric,
  "bk_qty_101" numeric,
  "bk_qty_102" numeric,
  "bk_qty_103" numeric,
  "bk_qty_104" numeric,
  "sum_qty_01" numeric,
  "sum_qty_02" numeric,
  "sum_qty_03" numeric,
  "sum_qty_04" numeric,
  "sum_qty_05" numeric,
  "sum_qty_06" numeric,
  "sum_qty_07" numeric,
  "sum_qty_08" numeric,
  "sum_qty_09" numeric,
  "sum_qty_10" numeric,
  "sum_qty_11" numeric,
  "sum_qty_12" numeric,
  "sum_qty_13" numeric,
  "sum_qty_14" numeric,
  "sum_qty_15" numeric,
  "sum_qty_16" numeric,
  "sum_qty_17" numeric,
  "sum_qty_18" numeric,
  "sum_qty_19" numeric,
  "sum_qty_20" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."resource_no" IS '资源编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."operation_code" IS '工序编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_bucket_data"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_capacity_allocation_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_capacity_allocation_planning_item";
CREATE TABLE "themetis_scp"."scp_capacity_allocation_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_capacity_allocation_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar COLLATE "pg_catalog"."default",
  "resource_type" varchar COLLATE "pg_catalog"."default",
  "resource_no" varchar COLLATE "pg_catalog"."default",
  "resource_group" varchar COLLATE "pg_catalog"."default",
  "operation_code" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "remarks" varchar COLLATE "pg_catalog"."default",
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default",
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."id" IS '表的主键，使用自增长序列生成唯一标识';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."demand_unit_code" IS '需求计划单元（市场）';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."supply_unit_code" IS '供应计划单元（工厂）';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."product_hierarchy_path" IS '产品层级路径';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."resource_type" IS '资源类型';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."resource_no" IS '资源编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."operation_code" IS '工序编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."customer_no" IS '客户编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."contract_no" IS '合同编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."supplier_no" IS '供应商编码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr01" IS '元属性 01';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr02" IS '元属性 02';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr03" IS '元属性 03';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr04" IS '元属性 04';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr05" IS '元属性 05';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr06" IS '元属性 06（保存缺口标记数据）';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr07" IS '元属性 07';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr08" IS '元属性 08';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr09" IS '元属性 09';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr10" IS '元属性 10';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr11" IS '元属性 11';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr12" IS '元属性 12';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr13" IS '元属性 13';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr14" IS '元属性 14';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr15" IS '元属性 15';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr16" IS '元属性 16';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr17" IS '元属性 17';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr18" IS '元属性 18';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr19" IS '元属性 19';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr20" IS '元属性 20';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr21" IS '元属性 21，时间戳类型';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr22" IS '元属性 22，时间戳类型';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr23" IS '元属性 23，时间戳类型';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr24" IS '元属性 24，时间戳类型';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr25" IS '元属性 25，时间戳类型';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr26" IS '元属性 26，数值类型，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr27" IS '元属性 27，数值类型，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr28" IS '元属性 28，数值类型，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr29" IS '元属性 29，数值类型，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."meta_attr30" IS '元属性 30，数值类型，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."creation_date" IS '创建日期';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."last_update_date" IS '最后更新日期';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."created_by" IS '创建人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."last_updated_by" IS '最后更新人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."tenant_id" IS '租户 ID';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_allocation_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_capacity_allocation_planning_item" IS '产能分配规划项目相关信息表';

-- ----------------------------
-- Table structure for scp_capacity_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_capacity_bucket_data";
CREATE TABLE "themetis_scp"."scp_capacity_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_capacity_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."supply_unit_code" IS '计划工厂';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."planner_code" IS '计划员';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_bucket_data"."resource_no" IS '产能包';
COMMENT ON TABLE "themetis_scp"."scp_capacity_bucket_data" IS '产能余缺数据';

-- ----------------------------
-- Table structure for scp_capacity_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_capacity_planning_item";
CREATE TABLE "themetis_scp"."scp_capacity_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_capacity_planning_item_id_seq'::regclass),
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "constraint_flag" bool,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "resource_description" varchar(100) COLLATE "pg_catalog"."default",
  "out_source_flag" bool,
  "standard_capacity" int4,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "risk_horizon_type" varchar(100) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."id" IS '主键';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."resource_no" IS '产能包';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."constraint_flag" IS '约束标识';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."resource_description" IS '资源描述';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."out_source_flag" IS '外协标识';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."standard_capacity" IS '标准产能';
COMMENT ON COLUMN "themetis_scp"."scp_capacity_planning_item"."risk_horizon_type" IS '风险类别';

-- ----------------------------
-- Table structure for scp_custom_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_custom_bucket_data";
CREATE TABLE "themetis_scp"."scp_custom_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_custom_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_custom_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_custom_bucket_data" IS '自定义工作台计划数据';

-- ----------------------------
-- Table structure for scp_custom_md_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_custom_md_data";
CREATE TABLE "themetis_scp"."scp_custom_md_data" (
  "tenant_id" int8 NOT NULL,
  "master_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "master_data_key" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr21" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr22" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr23" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr24" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr25" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr26" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr27" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr28" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr29" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr30" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr31" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr32" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr33" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr34" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr35" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr36" text COLLATE "pg_catalog"."default",
  "meta_attr37" text COLLATE "pg_catalog"."default",
  "meta_attr38" text COLLATE "pg_catalog"."default",
  "meta_attr39" text COLLATE "pg_catalog"."default",
  "meta_attr40" text COLLATE "pg_catalog"."default",
  "meta_attr41" timestamp(6),
  "meta_attr42" timestamp(6),
  "meta_attr43" timestamp(6),
  "meta_attr44" timestamp(6),
  "meta_attr45" timestamp(6),
  "meta_attr46" timestamp(6),
  "meta_attr47" timestamp(6),
  "meta_attr48" timestamp(6),
  "meta_attr49" timestamp(6),
  "meta_attr50" timestamp(6),
  "meta_attr51" numeric(20,6),
  "meta_attr52" numeric(20,6),
  "meta_attr53" numeric(20,6),
  "meta_attr54" numeric(20,6),
  "meta_attr55" numeric(20,6),
  "meta_attr56" numeric(20,6),
  "meta_attr57" numeric(20,6),
  "meta_attr58" numeric(20,6),
  "meta_attr59" numeric(20,6),
  "meta_attr60" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."master_data_type_code" IS '主数据代码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."master_data_key" IS '主数据键值';
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_custom_md_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON TABLE "themetis_scp"."scp_custom_md_data" IS '自定义主数据类型实际数据';

-- ----------------------------
-- Table structure for scp_custom_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_custom_planning_item";
CREATE TABLE "themetis_scp"."scp_custom_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_custom_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."material_group_code" IS '物料组';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_custom_planning_item" IS '自定义计划对象数据';

-- ----------------------------
-- Table structure for scp_custom_planning_item_copy1
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_custom_planning_item_copy1";
CREATE TABLE "themetis_scp"."scp_custom_planning_item_copy1" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_custom_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."material_group_code" IS '物料组';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_custom_planning_item_copy1"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_custom_planning_item_copy1" IS '自定义计划对象数据';

-- ----------------------------
-- Table structure for scp_distribution_order_exception
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_distribution_order_exception";
CREATE TABLE "themetis_scp"."scp_distribution_order_exception" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_distribution_order_exception_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "distribution_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "distribution_order_line_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "original_order_line_id" int8 NOT NULL,
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "material_distribution_path_no" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(100) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "original_required_quantity" numeric(20,6) NOT NULL,
  "original_request_shipping_date" timestamp(6) NOT NULL,
  "suggested_shipping_quantity" numeric(20,6),
  "suggested_shipping_date" timestamp(6),
  "exception_action_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_priority" int8,
  "on_way_quantity" numeric(20,6),
  "arrival_quantity" numeric(20,6),
  "estimated_arrival_date" timestamp(6),
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "distribution_type" varchar(50) COLLATE "pg_catalog"."default",
  "distribution_priority" int8,
  "distribution_ratio" numeric(8,6),
  "consolidation_days" int4,
  "consolidation_bucket_start_date" timestamp(6),
  "consolidation_bucket_end_date" timestamp(6),
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."distribution_order_no" IS '分销单号';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."distribution_order_line_no" IS '分销单行号';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."original_order_line_id" IS '源系统分销订单行ID';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."material" IS '物料编码';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."original_required_quantity" IS '原要求分销数量';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."original_request_shipping_date" IS '原要求发货日期';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."suggested_shipping_quantity" IS '建议发货数量';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."suggested_shipping_date" IS '建议发货日期';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."exception_action_type" IS '例外类型：ADVANCE提前，POSTPONE推后，CANCEL取消';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."demand_priority" IS '需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."on_way_quantity" IS '在途数量';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."arrival_quantity" IS '到货数量';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."estimated_arrival_date" IS '预计到货日期';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."distribution_type" IS '分销类型';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."distribution_priority" IS '分销优先级';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."distribution_ratio" IS '分销比例';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."consolidation_bucket_start_date" IS '固定供应时段起点';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."consolidation_bucket_end_date" IS '固定供应时段终点';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_distribution_order_exception"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_distribution_order_exception" IS '分销例外信息';

-- ----------------------------
-- Table structure for scp_dp_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_dp_bucket_data";
CREATE TABLE "themetis_scp"."scp_dp_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_dp_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default",
  "config_part_code" varchar(200) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."config_part_code" IS '配置项编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_dp_bucket_data" IS '需求计划';

-- ----------------------------
-- Table structure for scp_dp_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_dp_planning_item";
CREATE TABLE "themetis_scp"."scp_dp_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_dp_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "make_to_stock_type" varchar(30) COLLATE "pg_catalog"."default",
  "full_kit_fulfillment_flag" bool DEFAULT false,
  "workshop_no" varchar(30) COLLATE "pg_catalog"."default",
  "supply_consistency_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default",
  "config_part_code" varchar(200) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "material_desc" varchar(1000) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."make_to_stock_type" IS '囤货订单标识';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."full_kit_fulfillment_flag" IS '是否齐套履行';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."workshop_no" IS '预测直接指定车间，可直接消耗车间仓库供应，并按车间冲减';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."supply_consistency_group_code" IS '供应一致性组号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."config_part_code" IS '配置项编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_dp_planning_item"."material_desc" IS '零部件名称';
COMMENT ON TABLE "themetis_scp"."scp_dp_planning_item" IS '需求计划对象数据';

-- ----------------------------
-- Table structure for scp_dp_waterfall_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_dp_waterfall_data";
CREATE TABLE "themetis_scp"."scp_dp_waterfall_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_dp_waterfall_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."compare_planning_period_type_code" IS 'waterfall比较期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."compare_planning_period_code" IS 'waterfall比较期次码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_dp_waterfall_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_dp_waterfall_data" IS '需求计划';

-- ----------------------------
-- Table structure for scp_fcst_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_fcst_bucket_data";
CREATE TABLE "themetis_scp"."scp_fcst_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_fcst_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "config_part_code" varchar(200) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."config_part_code" IS '配置项编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_fcst_bucket_data" IS 'DP需求预测bucket数据';

-- ----------------------------
-- Table structure for scp_fcst_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_fcst_planning_item";
CREATE TABLE "themetis_scp"."scp_fcst_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_fcst_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "config_part_code" varchar(200) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "production_plan_driven_method" varchar(100) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "material_desc" varchar(200) COLLATE "pg_catalog"."default",
  "data_anomaly_flag" bool,
  "empty_flag" bool
)
;
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."config_part_code" IS '配置项编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."production_plan_driven_method" IS '生产计划驱动模式,配置lookup=production_plan_driven_method,枚举值：主生产计划MPS, 仅订单需求ORD, 订单&净计划ORD_NET_MPS, 订单&净计划&调整需求量ORD_NET_MPS_IND, 独立需求IND';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."material_desc" IS '零部件名称';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."data_anomaly_flag" IS '异常数据标识';
COMMENT ON COLUMN "themetis_scp"."scp_fcst_planning_item"."empty_flag" IS '为空标识（未过期bucket值全为空时赋值true）';
COMMENT ON TABLE "themetis_scp"."scp_fcst_planning_item" IS 'DP需求预测计划对象数据';

-- ----------------------------
-- Table structure for scp_ind_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_ind_bucket_data";
CREATE TABLE "themetis_scp"."scp_ind_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_ind_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_ind_bucket_data" IS '独立需求计划';

-- ----------------------------
-- Table structure for scp_ind_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_ind_planning_item";
CREATE TABLE "themetis_scp"."scp_ind_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_ind_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "make_to_stock_type" varchar(30) COLLATE "pg_catalog"."default",
  "full_kit_fulfillment_flag" bool DEFAULT false,
  "workshop_no" varchar(30) COLLATE "pg_catalog"."default",
  "supply_consistency_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "empty_flag" bool
)
;
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."make_to_stock_type" IS '囤货订单标识';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."full_kit_fulfillment_flag" IS '是否齐套履行';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."workshop_no" IS '预测直接指定车间，可直接消耗车间仓库供应，并按车间冲减';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."supply_consistency_group_code" IS '供应一致性组号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."supply_center_code" IS '供应中心编号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_ind_planning_item"."empty_flag" IS '为空标识（未过期bucket值全为空时赋值true）';
COMMENT ON TABLE "themetis_scp"."scp_ind_planning_item" IS '独立需求计划对象数据';

-- ----------------------------
-- Table structure for scp_ind_waterfall_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_ind_waterfall_data";
CREATE TABLE "themetis_scp"."scp_ind_waterfall_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_ind_waterfall_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."compare_planning_period_type_code" IS 'waterfall比较期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."compare_planning_period_code" IS 'waterfall比较期次码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_ind_waterfall_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_ind_waterfall_data" IS '独立需求计划';

-- ----------------------------
-- Table structure for scp_inventory_anlysis_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_inventory_anlysis_bucket_data";
CREATE TABLE "themetis_scp"."scp_inventory_anlysis_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_inventory_anlysis_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_inventory_anlysis_bucket_data" IS '预缺料数据';

-- ----------------------------
-- Table structure for scp_inventory_anlysis_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_inventory_anlysis_planning_item";
CREATE TABLE "themetis_scp"."scp_inventory_anlysis_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_inventory_anlysis_planning_item_id_seq'::regclass),
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "shortage_date" date,
  "current_inventory_quantity" numeric(20,6),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "purchasing_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "buyer_id" int8,
  "supplier_code" varchar(100) COLLATE "pg_catalog"."default",
  "min_lot_size" numeric(20,6),
  "max_lot_size" numeric(20,6),
  "lot_size_multiple" numeric(20,6),
  "consolidation_days" int4,
  "lead_time" numeric(20,6),
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "constraint_flag" bool,
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."current_inventory_quantity" IS '当前库存';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."purchasing_delivery_method" IS '采购物料交付方式：NORMAL/JIT/VMI';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."buyer_id" IS '采购员用户ID';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."supplier_code" IS '供应商编码';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."min_lot_size" IS '最小批量';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."max_lot_size" IS '最大批量';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."lot_size_multiple" IS '批量倍数';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."lead_time" IS '采购周期';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."constraint_flag" IS '约束标识';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_inventory_anlysis_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_inventory_anlysis_planning_item" IS '原材料预缺料计划对象数据';

-- ----------------------------
-- Table structure for scp_jit_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_jit_bucket_data";
CREATE TABLE "themetis_scp"."scp_jit_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_jit_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "parent_material" varchar(200) COLLATE "pg_catalog"."default",
  "location_code" varchar(100) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "vendor_code" varchar(50) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "manufacturer_part_no" varchar(100) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."material_group_code" IS '物料分组号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."parent_material" IS '父项物料';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."location_code" IS '地点代码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."vendor_code" IS '供应商编码（拆分用）';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."manufacturer_part_no" IS '制造商零件编码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_jit_bucket_data" IS '主计划计划数据';

-- ----------------------------
-- Table structure for scp_jit_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_jit_planning_item";
CREATE TABLE "themetis_scp"."scp_jit_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_jit_planning_item_id_seq'::regclass),
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "parent_material" varchar(200) COLLATE "pg_catalog"."default",
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "location_code" varchar(100) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "vendor_code" varchar(50) COLLATE "pg_catalog"."default",
  "allocation_ratio" numeric(8,6),
  "purchasing_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "vendor_name" varchar(200) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "jit_material_pull_cycle" numeric(20,6),
  "available_inv_quantity" numeric(20,6),
  "delivered_quantity" numeric(20,6) DEFAULT NULL::numeric,
  "min_packing_quantity" numeric(20,6),
  "manufacturer_part_no" varchar(100) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "error_message" varchar(1000) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."material_group_code" IS '物料分组号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."attribute_code" IS '属性';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."parent_material" IS '父项物料';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."location_code" IS '地点代码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."customer_no" IS '客户编号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."contract_no" IS '合同编号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."project_code" IS '项目代码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."supplier_no" IS '指定供应商编号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."risk_level" IS '欠料风险等级';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."production_delivery_method" IS '生产交付方式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."vendor_code" IS '供应商编码（拆分用）';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."allocation_ratio" IS '分配比例';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."purchasing_delivery_method" IS '采购物料交付方式：NORMAL/JIT/VMI';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."vendor_name" IS '供应商名称';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."jit_material_pull_cycle" IS 'JIT叫料周期';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."available_inv_quantity" IS '可用库存数量';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."delivered_quantity" IS '已交单数量';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."min_packing_quantity" IS '最小包装数量';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."manufacturer_part_no" IS '制造商零件编码';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."interface_status" IS '接口状态，0失败 1成功';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_jit_planning_item"."error_message" IS '接口返回信息';
COMMENT ON TABLE "themetis_scp"."scp_jit_planning_item" IS 'JIT叫料计划对象数据';

-- ----------------------------
-- Table structure for scp_material_allocation_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_allocation_bucket_data";
CREATE TABLE "themetis_scp"."scp_material_allocation_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_allocation_bucket_data_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "figure_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_code" varchar COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar COLLATE "pg_catalog"."default",
  "source_period_code" varchar COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric,
  "bk_qty_002" numeric,
  "bk_qty_003" numeric,
  "bk_qty_004" numeric,
  "bk_qty_005" numeric,
  "bk_qty_006" numeric,
  "bk_qty_007" numeric,
  "bk_qty_008" numeric,
  "bk_qty_009" numeric,
  "bk_qty_010" numeric,
  "bk_qty_011" numeric,
  "bk_qty_012" numeric,
  "bk_qty_013" numeric,
  "bk_qty_014" numeric,
  "bk_qty_015" numeric,
  "bk_qty_016" numeric,
  "bk_qty_017" numeric,
  "bk_qty_018" numeric,
  "bk_qty_019" numeric,
  "bk_qty_020" numeric,
  "bk_qty_021" numeric,
  "bk_qty_022" numeric,
  "bk_qty_023" numeric,
  "bk_qty_024" numeric,
  "bk_qty_025" numeric,
  "bk_qty_026" numeric,
  "bk_qty_027" numeric,
  "bk_qty_028" numeric,
  "bk_qty_029" numeric,
  "bk_qty_030" numeric,
  "bk_qty_031" numeric,
  "bk_qty_032" numeric,
  "bk_qty_033" numeric,
  "bk_qty_034" numeric,
  "bk_qty_035" numeric,
  "bk_qty_036" numeric,
  "bk_qty_037" numeric,
  "bk_qty_038" numeric,
  "bk_qty_039" numeric,
  "bk_qty_040" numeric,
  "bk_qty_041" numeric,
  "bk_qty_042" numeric,
  "bk_qty_043" numeric,
  "bk_qty_044" numeric,
  "bk_qty_045" numeric,
  "bk_qty_046" numeric,
  "bk_qty_047" numeric,
  "bk_qty_048" numeric,
  "bk_qty_049" numeric,
  "bk_qty_050" numeric,
  "bk_qty_051" numeric,
  "bk_qty_052" numeric,
  "bk_qty_053" numeric,
  "bk_qty_054" numeric,
  "bk_qty_055" numeric,
  "bk_qty_056" numeric,
  "bk_qty_057" numeric,
  "bk_qty_058" numeric,
  "bk_qty_059" numeric,
  "bk_qty_060" numeric,
  "bk_qty_061" numeric,
  "bk_qty_062" numeric,
  "bk_qty_063" numeric,
  "bk_qty_064" numeric,
  "bk_qty_065" numeric,
  "bk_qty_066" numeric,
  "bk_qty_067" numeric,
  "bk_qty_068" numeric,
  "bk_qty_069" numeric,
  "bk_qty_070" numeric,
  "bk_qty_071" numeric,
  "bk_qty_072" numeric,
  "bk_qty_073" numeric,
  "bk_qty_074" numeric,
  "bk_qty_075" numeric,
  "bk_qty_076" numeric,
  "bk_qty_077" numeric,
  "bk_qty_078" numeric,
  "bk_qty_079" numeric,
  "bk_qty_080" numeric,
  "bk_qty_081" numeric,
  "bk_qty_082" numeric,
  "bk_qty_083" numeric,
  "bk_qty_084" numeric,
  "bk_qty_085" numeric,
  "bk_qty_086" numeric,
  "bk_qty_087" numeric,
  "bk_qty_088" numeric,
  "bk_qty_089" numeric,
  "bk_qty_090" numeric,
  "bk_qty_091" numeric,
  "bk_qty_092" numeric,
  "bk_qty_093" numeric,
  "bk_qty_094" numeric,
  "bk_qty_095" numeric,
  "bk_qty_096" numeric,
  "bk_qty_097" numeric,
  "bk_qty_098" numeric,
  "bk_qty_099" numeric,
  "bk_qty_100" numeric,
  "bk_qty_101" numeric,
  "bk_qty_102" numeric,
  "bk_qty_103" numeric,
  "bk_qty_104" numeric,
  "sum_qty_01" numeric,
  "sum_qty_02" numeric,
  "sum_qty_03" numeric,
  "sum_qty_04" numeric,
  "sum_qty_05" numeric,
  "sum_qty_06" numeric,
  "sum_qty_07" numeric,
  "sum_qty_08" numeric,
  "sum_qty_09" numeric,
  "sum_qty_10" numeric,
  "sum_qty_11" numeric,
  "sum_qty_12" numeric,
  "sum_qty_13" numeric,
  "sum_qty_14" numeric,
  "sum_qty_15" numeric,
  "sum_qty_16" numeric,
  "sum_qty_17" numeric,
  "sum_qty_18" numeric,
  "sum_qty_19" numeric,
  "sum_qty_20" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_allocation_bucket_data" IS '物料分配桶信息表';

-- ----------------------------
-- Table structure for scp_material_allocation_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_allocation_planning_item";
CREATE TABLE "themetis_scp"."scp_material_allocation_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_allocation_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "material_category_lv1" varchar COLLATE "pg_catalog"."default",
  "material_category_lv2" varchar COLLATE "pg_catalog"."default",
  "material_category_lv3" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "buyer_id" varchar(100) COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default",
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar COLLATE "pg_catalog"."default",
  "meta_attr02" varchar COLLATE "pg_catalog"."default",
  "meta_attr03" varchar COLLATE "pg_catalog"."default",
  "meta_attr04" varchar COLLATE "pg_catalog"."default",
  "meta_attr05" varchar COLLATE "pg_catalog"."default",
  "meta_attr06" varchar COLLATE "pg_catalog"."default",
  "meta_attr07" varchar COLLATE "pg_catalog"."default",
  "meta_attr08" varchar COLLATE "pg_catalog"."default",
  "meta_attr09" varchar COLLATE "pg_catalog"."default",
  "meta_attr10" varchar COLLATE "pg_catalog"."default",
  "meta_attr11" varchar COLLATE "pg_catalog"."default",
  "meta_attr12" varchar COLLATE "pg_catalog"."default",
  "meta_attr13" varchar COLLATE "pg_catalog"."default",
  "meta_attr14" varchar COLLATE "pg_catalog"."default",
  "meta_attr15" varchar COLLATE "pg_catalog"."default",
  "meta_attr16" varchar COLLATE "pg_catalog"."default",
  "meta_attr17" varchar COLLATE "pg_catalog"."default",
  "meta_attr18" varchar COLLATE "pg_catalog"."default",
  "meta_attr19" varchar COLLATE "pg_catalog"."default",
  "meta_attr20" varchar COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."id" IS '主键，自动生成的序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."demand_unit_code" IS '需求计划单元(市场)';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."material_group_code" IS '物料分组号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."material_category_lv1" IS '物料大类';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."material_category_lv2" IS '物料中类';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."material_category_lv3" IS '物料小类';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."buyer_id" IS '采购员 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."customer_no" IS '客户编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."contract_no" IS '合同编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."supplier_no" IS '供应商编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr01" IS '滚动计划号(外销订单号)，可有多个';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr02" IS '机型(生产版本)，可有多个';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr03" IS '整机/BOM/单机用量 要显示，可有多个';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr04" IS '物料描述';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr05" IS '缺口物料瓶颈原因';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr06" IS '缺口数据';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr07" IS '共用物料';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr08" IS '国家';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr09" IS '预留字段 09';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr10" IS '预留字段 10';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr11" IS '预留字段 11';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr12" IS '预留字段 12';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr13" IS '预留字段 13';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr14" IS '预留字段 14';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr15" IS '预留字段 15';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr16" IS '预留字段 16';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr17" IS '预留字段 17';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr18" IS '预留字段 18';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr19" IS '预留字段 19';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr20" IS '型号/料号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr21" IS '预留时间戳字段 21';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr22" IS '预留时间戳字段 22';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr23" IS '预留时间戳字段 23';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr24" IS '预留时间戳字段 24';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr25" IS '预留时间戳字段 25';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr26" IS '预留数值字段 26，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr27" IS '预留数值字段 27，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr28" IS '预留数值字段 28，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr29" IS '预留数值字段 29，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."meta_attr30" IS '预留数值字段 30，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."creation_date" IS '创建日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."last_update_date" IS '最后更新日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."created_by" IS '创建人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."last_updated_by" IS '最后更新人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."tenant_id" IS '租户 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_allocation_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_allocation_planning_item" IS '物料跨市场分配表';

-- ----------------------------
-- Table structure for scp_material_demand_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_demand_bucket_data";
CREATE TABLE "themetis_scp"."scp_material_demand_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_demand_bucket_data_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "figure_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_code" varchar COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar COLLATE "pg_catalog"."default",
  "source_period_code" varchar COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric,
  "bk_qty_002" numeric,
  "bk_qty_003" numeric,
  "bk_qty_004" numeric,
  "bk_qty_005" numeric,
  "bk_qty_006" numeric,
  "bk_qty_007" numeric,
  "bk_qty_008" numeric,
  "bk_qty_009" numeric,
  "bk_qty_010" numeric,
  "bk_qty_011" numeric,
  "bk_qty_012" numeric,
  "bk_qty_013" numeric,
  "bk_qty_014" numeric,
  "bk_qty_015" numeric,
  "bk_qty_016" numeric,
  "bk_qty_017" numeric,
  "bk_qty_018" numeric,
  "bk_qty_019" numeric,
  "bk_qty_020" numeric,
  "bk_qty_021" numeric,
  "bk_qty_022" numeric,
  "bk_qty_023" numeric,
  "bk_qty_024" numeric,
  "bk_qty_025" numeric,
  "bk_qty_026" numeric,
  "bk_qty_027" numeric,
  "bk_qty_028" numeric,
  "bk_qty_029" numeric,
  "bk_qty_030" numeric,
  "bk_qty_031" numeric,
  "bk_qty_032" numeric,
  "bk_qty_033" numeric,
  "bk_qty_034" numeric,
  "bk_qty_035" numeric,
  "bk_qty_036" numeric,
  "bk_qty_037" numeric,
  "bk_qty_038" numeric,
  "bk_qty_039" numeric,
  "bk_qty_040" numeric,
  "bk_qty_041" numeric,
  "bk_qty_042" numeric,
  "bk_qty_043" numeric,
  "bk_qty_044" numeric,
  "bk_qty_045" numeric,
  "bk_qty_046" numeric,
  "bk_qty_047" numeric,
  "bk_qty_048" numeric,
  "bk_qty_049" numeric,
  "bk_qty_050" numeric,
  "bk_qty_051" numeric,
  "bk_qty_052" numeric,
  "bk_qty_053" numeric,
  "bk_qty_054" numeric,
  "bk_qty_055" numeric,
  "bk_qty_056" numeric,
  "bk_qty_057" numeric,
  "bk_qty_058" numeric,
  "bk_qty_059" numeric,
  "bk_qty_060" numeric,
  "bk_qty_061" numeric,
  "bk_qty_062" numeric,
  "bk_qty_063" numeric,
  "bk_qty_064" numeric,
  "bk_qty_065" numeric,
  "bk_qty_066" numeric,
  "bk_qty_067" numeric,
  "bk_qty_068" numeric,
  "bk_qty_069" numeric,
  "bk_qty_070" numeric,
  "bk_qty_071" numeric,
  "bk_qty_072" numeric,
  "bk_qty_073" numeric,
  "bk_qty_074" numeric,
  "bk_qty_075" numeric,
  "bk_qty_076" numeric,
  "bk_qty_077" numeric,
  "bk_qty_078" numeric,
  "bk_qty_079" numeric,
  "bk_qty_080" numeric,
  "bk_qty_081" numeric,
  "bk_qty_082" numeric,
  "bk_qty_083" numeric,
  "bk_qty_084" numeric,
  "bk_qty_085" numeric,
  "bk_qty_086" numeric,
  "bk_qty_087" numeric,
  "bk_qty_088" numeric,
  "bk_qty_089" numeric,
  "bk_qty_090" numeric,
  "bk_qty_091" numeric,
  "bk_qty_092" numeric,
  "bk_qty_093" numeric,
  "bk_qty_094" numeric,
  "bk_qty_095" numeric,
  "bk_qty_096" numeric,
  "bk_qty_097" numeric,
  "bk_qty_098" numeric,
  "bk_qty_099" numeric,
  "bk_qty_100" numeric,
  "bk_qty_101" numeric,
  "bk_qty_102" numeric,
  "bk_qty_103" numeric,
  "bk_qty_104" numeric,
  "sum_qty_01" numeric,
  "sum_qty_02" numeric,
  "sum_qty_03" numeric,
  "sum_qty_04" numeric,
  "sum_qty_05" numeric,
  "sum_qty_06" numeric,
  "sum_qty_07" numeric,
  "sum_qty_08" numeric,
  "sum_qty_09" numeric,
  "sum_qty_10" numeric,
  "sum_qty_11" numeric,
  "sum_qty_12" numeric,
  "sum_qty_13" numeric,
  "sum_qty_14" numeric,
  "sum_qty_15" numeric,
  "sum_qty_16" numeric,
  "sum_qty_17" numeric,
  "sum_qty_18" numeric,
  "sum_qty_19" numeric,
  "sum_qty_20" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_demand_bucket_data" IS '物料需求明细表';

-- ----------------------------
-- Table structure for scp_material_demand_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_demand_planning_item";
CREATE TABLE "themetis_scp"."scp_material_demand_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_demand_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "material_category_lv1" varchar COLLATE "pg_catalog"."default",
  "material_category_lv2" varchar COLLATE "pg_catalog"."default",
  "material_category_lv3" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "buyer_id" varchar(100) COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default",
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar COLLATE "pg_catalog"."default",
  "meta_attr02" varchar COLLATE "pg_catalog"."default",
  "meta_attr03" varchar COLLATE "pg_catalog"."default",
  "meta_attr04" varchar COLLATE "pg_catalog"."default",
  "meta_attr05" varchar COLLATE "pg_catalog"."default",
  "meta_attr06" varchar COLLATE "pg_catalog"."default",
  "meta_attr07" varchar COLLATE "pg_catalog"."default",
  "meta_attr08" varchar COLLATE "pg_catalog"."default",
  "meta_attr09" varchar COLLATE "pg_catalog"."default",
  "meta_attr10" varchar COLLATE "pg_catalog"."default",
  "meta_attr11" varchar COLLATE "pg_catalog"."default",
  "meta_attr12" varchar COLLATE "pg_catalog"."default",
  "meta_attr13" varchar COLLATE "pg_catalog"."default",
  "meta_attr14" varchar COLLATE "pg_catalog"."default",
  "meta_attr15" varchar COLLATE "pg_catalog"."default",
  "meta_attr16" varchar COLLATE "pg_catalog"."default",
  "meta_attr17" varchar COLLATE "pg_catalog"."default",
  "meta_attr18" varchar COLLATE "pg_catalog"."default",
  "meta_attr19" varchar COLLATE "pg_catalog"."default",
  "meta_attr20" varchar COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."id" IS '主键，自动生成的序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."demand_unit_code" IS '需求计划单元(市场)';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."material_group_code" IS '物料分组号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."material_category_lv1" IS '物料大类';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."material_category_lv2" IS '物料中类';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."material_category_lv3" IS '物料小类';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."buyer_id" IS '采购员 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."customer_no" IS '客户编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."contract_no" IS '合同编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."supplier_no" IS '供应商编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr01" IS '生产型号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr02" IS '机型(生产版本)';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr03" IS 'BOMID_版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr04" IS '物料描述';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr05" IS '出货方式';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr06" IS '机芯要求（出口）';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr07" IS '预留字段 07';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr08" IS '预留字段 08';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr09" IS '预留字段 09';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr10" IS '预留字段 10';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr11" IS '预留字段 11';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr12" IS '预留字段 12';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr13" IS '预留字段 13';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr14" IS '预留字段 14';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr15" IS '预留字段 15';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr16" IS '预留字段 16';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr17" IS '预留字段 17';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr18" IS '预留字段 18';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr19" IS '预留字段 19';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr20" IS '型号/料号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr21" IS '排定时间';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr22" IS '预留时间戳字段 22';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr23" IS '预留时间戳字段 23';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr24" IS '预留时间戳字段 24';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr25" IS '预留时间戳字段 25';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr26" IS '单机用量';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr27" IS '预留数值字段 27，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr28" IS '预留数值字段 28，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr29" IS '预留数值字段 29，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."meta_attr30" IS '预留数值字段 30，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."creation_date" IS '创建日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."last_update_date" IS '最后更新日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."created_by" IS '创建人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."last_updated_by" IS '最后更新人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."tenant_id" IS '租户 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_demand_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_demand_planning_item" IS '物料需求明细';

-- ----------------------------
-- Table structure for scp_material_mold_demand_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_mold_demand_bucket_data";
CREATE TABLE "themetis_scp"."scp_material_mold_demand_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_mold_demand_bucket_data_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "figure_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_code" varchar COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar COLLATE "pg_catalog"."default",
  "source_period_code" varchar COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric,
  "bk_qty_002" numeric,
  "bk_qty_003" numeric,
  "bk_qty_004" numeric,
  "bk_qty_005" numeric,
  "bk_qty_006" numeric,
  "bk_qty_007" numeric,
  "bk_qty_008" numeric,
  "bk_qty_009" numeric,
  "bk_qty_010" numeric,
  "bk_qty_011" numeric,
  "bk_qty_012" numeric,
  "bk_qty_013" numeric,
  "bk_qty_014" numeric,
  "bk_qty_015" numeric,
  "bk_qty_016" numeric,
  "bk_qty_017" numeric,
  "bk_qty_018" numeric,
  "bk_qty_019" numeric,
  "bk_qty_020" numeric,
  "bk_qty_021" numeric,
  "bk_qty_022" numeric,
  "bk_qty_023" numeric,
  "bk_qty_024" numeric,
  "bk_qty_025" numeric,
  "bk_qty_026" numeric,
  "bk_qty_027" numeric,
  "bk_qty_028" numeric,
  "bk_qty_029" numeric,
  "bk_qty_030" numeric,
  "bk_qty_031" numeric,
  "bk_qty_032" numeric,
  "bk_qty_033" numeric,
  "bk_qty_034" numeric,
  "bk_qty_035" numeric,
  "bk_qty_036" numeric,
  "bk_qty_037" numeric,
  "bk_qty_038" numeric,
  "bk_qty_039" numeric,
  "bk_qty_040" numeric,
  "bk_qty_041" numeric,
  "bk_qty_042" numeric,
  "bk_qty_043" numeric,
  "bk_qty_044" numeric,
  "bk_qty_045" numeric,
  "bk_qty_046" numeric,
  "bk_qty_047" numeric,
  "bk_qty_048" numeric,
  "bk_qty_049" numeric,
  "bk_qty_050" numeric,
  "bk_qty_051" numeric,
  "bk_qty_052" numeric,
  "bk_qty_053" numeric,
  "bk_qty_054" numeric,
  "bk_qty_055" numeric,
  "bk_qty_056" numeric,
  "bk_qty_057" numeric,
  "bk_qty_058" numeric,
  "bk_qty_059" numeric,
  "bk_qty_060" numeric,
  "bk_qty_061" numeric,
  "bk_qty_062" numeric,
  "bk_qty_063" numeric,
  "bk_qty_064" numeric,
  "bk_qty_065" numeric,
  "bk_qty_066" numeric,
  "bk_qty_067" numeric,
  "bk_qty_068" numeric,
  "bk_qty_069" numeric,
  "bk_qty_070" numeric,
  "bk_qty_071" numeric,
  "bk_qty_072" numeric,
  "bk_qty_073" numeric,
  "bk_qty_074" numeric,
  "bk_qty_075" numeric,
  "bk_qty_076" numeric,
  "bk_qty_077" numeric,
  "bk_qty_078" numeric,
  "bk_qty_079" numeric,
  "bk_qty_080" numeric,
  "bk_qty_081" numeric,
  "bk_qty_082" numeric,
  "bk_qty_083" numeric,
  "bk_qty_084" numeric,
  "bk_qty_085" numeric,
  "bk_qty_086" numeric,
  "bk_qty_087" numeric,
  "bk_qty_088" numeric,
  "bk_qty_089" numeric,
  "bk_qty_090" numeric,
  "bk_qty_091" numeric,
  "bk_qty_092" numeric,
  "bk_qty_093" numeric,
  "bk_qty_094" numeric,
  "bk_qty_095" numeric,
  "bk_qty_096" numeric,
  "bk_qty_097" numeric,
  "bk_qty_098" numeric,
  "bk_qty_099" numeric,
  "bk_qty_100" numeric,
  "bk_qty_101" numeric,
  "bk_qty_102" numeric,
  "bk_qty_103" numeric,
  "bk_qty_104" numeric,
  "sum_qty_01" numeric,
  "sum_qty_02" numeric,
  "sum_qty_03" numeric,
  "sum_qty_04" numeric,
  "sum_qty_05" numeric,
  "sum_qty_06" numeric,
  "sum_qty_07" numeric,
  "sum_qty_08" numeric,
  "sum_qty_09" numeric,
  "sum_qty_10" numeric,
  "sum_qty_11" numeric,
  "sum_qty_12" numeric,
  "sum_qty_13" numeric,
  "sum_qty_14" numeric,
  "sum_qty_15" numeric,
  "sum_qty_16" numeric,
  "sum_qty_17" numeric,
  "sum_qty_18" numeric,
  "sum_qty_19" numeric,
  "sum_qty_20" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_mold_demand_bucket_data" IS '物料模具需求明细表';

-- ----------------------------
-- Table structure for scp_material_mold_demand_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_mold_demand_planning_item";
CREATE TABLE "themetis_scp"."scp_material_mold_demand_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_mold_demand_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "material_category_lv1" varchar COLLATE "pg_catalog"."default",
  "material_category_lv2" varchar COLLATE "pg_catalog"."default",
  "material_category_lv3" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "buyer_id" varchar(100) COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default",
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."id" IS '主键，自动生成的序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."demand_unit_code" IS '需求计划单元(市场)';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."material_group_code" IS '物料分组号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."material_category_lv1" IS '物料大类';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."material_category_lv2" IS '物料中类';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."material_category_lv3" IS '物料小类';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."buyer_id" IS '采购员 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."customer_no" IS '客户编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."contract_no" IS '合同编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."supplier_no" IS '供应商编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr01" IS '生产型号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr02" IS '机型(生产版本)';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr03" IS 'BOMID_版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr04" IS '物料描述';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr05" IS '屏料号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr06" IS '屏型号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr07" IS '模制件';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr08" IS '模制件物料描述';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr09" IS '图号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr10" IS '模具名称';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr11" IS '模具所在基地';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr12" IS '预留字段 12';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr13" IS '预留字段 13';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr14" IS '预留字段 14';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr15" IS '预留字段 15';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr16" IS '预留字段 16';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr17" IS '预留字段 17';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr18" IS '预留字段 18';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr19" IS '预留字段 19';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr20" IS '型号/料号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr21" IS '排定时间';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr22" IS '预留时间戳字段 22';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr23" IS '预留时间戳字段 23';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr24" IS '预留时间戳字段 24';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr25" IS '预留时间戳字段 25';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr26" IS '单机用量';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr27" IS '预留数值字段 27，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr28" IS '预留数值字段 28，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr29" IS '预留数值字段 29，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."meta_attr30" IS '预留数值字段 30，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."creation_date" IS '创建日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."last_update_date" IS '最后更新日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."created_by" IS '创建人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."last_updated_by" IS '最后更新人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."tenant_id" IS '租户 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_demand_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_mold_demand_planning_item" IS '物料模具需求明细';

-- ----------------------------
-- Table structure for scp_material_mold_supply_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_mold_supply_bucket_data";
CREATE TABLE "themetis_scp"."scp_material_mold_supply_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_mold_supply_bucket_data_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default",
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "figure_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar COLLATE "pg_catalog"."default",
  "source_figure_code" varchar COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar COLLATE "pg_catalog"."default",
  "source_period_code" varchar COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "product_model_number" varchar(200) COLLATE "pg_catalog"."default",
  "mold_qty" int4,
  "uph" int4,
  "supplier_inventory_qty" int4,
  "bk_qty_001" numeric,
  "bk_qty_002" numeric,
  "bk_qty_003" numeric,
  "bk_qty_004" numeric,
  "bk_qty_005" numeric,
  "bk_qty_006" numeric,
  "bk_qty_007" numeric,
  "bk_qty_008" numeric,
  "bk_qty_009" numeric,
  "bk_qty_010" numeric,
  "bk_qty_011" numeric,
  "bk_qty_012" numeric,
  "bk_qty_013" numeric,
  "bk_qty_014" numeric,
  "bk_qty_015" numeric,
  "bk_qty_016" numeric,
  "bk_qty_017" numeric,
  "bk_qty_018" numeric,
  "bk_qty_019" numeric,
  "bk_qty_020" numeric,
  "bk_qty_021" numeric,
  "bk_qty_022" numeric,
  "bk_qty_023" numeric,
  "bk_qty_024" numeric,
  "bk_qty_025" numeric,
  "bk_qty_026" numeric,
  "bk_qty_027" numeric,
  "bk_qty_028" numeric,
  "bk_qty_029" numeric,
  "bk_qty_030" numeric,
  "bk_qty_031" numeric,
  "bk_qty_032" numeric,
  "bk_qty_033" numeric,
  "bk_qty_034" numeric,
  "bk_qty_035" numeric,
  "bk_qty_036" numeric,
  "bk_qty_037" numeric,
  "bk_qty_038" numeric,
  "bk_qty_039" numeric,
  "bk_qty_040" numeric,
  "bk_qty_041" numeric,
  "bk_qty_042" numeric,
  "bk_qty_043" numeric,
  "bk_qty_044" numeric,
  "bk_qty_045" numeric,
  "bk_qty_046" numeric,
  "bk_qty_047" numeric,
  "bk_qty_048" numeric,
  "bk_qty_049" numeric,
  "bk_qty_050" numeric,
  "bk_qty_051" numeric,
  "bk_qty_052" numeric,
  "bk_qty_053" numeric,
  "bk_qty_054" numeric,
  "bk_qty_055" numeric,
  "bk_qty_056" numeric,
  "bk_qty_057" numeric,
  "bk_qty_058" numeric,
  "bk_qty_059" numeric,
  "bk_qty_060" numeric,
  "bk_qty_061" numeric,
  "bk_qty_062" numeric,
  "bk_qty_063" numeric,
  "bk_qty_064" numeric,
  "bk_qty_065" numeric,
  "bk_qty_066" numeric,
  "bk_qty_067" numeric,
  "bk_qty_068" numeric,
  "bk_qty_069" numeric,
  "bk_qty_070" numeric,
  "bk_qty_071" numeric,
  "bk_qty_072" numeric,
  "bk_qty_073" numeric,
  "bk_qty_074" numeric,
  "bk_qty_075" numeric,
  "bk_qty_076" numeric,
  "bk_qty_077" numeric,
  "bk_qty_078" numeric,
  "bk_qty_079" numeric,
  "bk_qty_080" numeric,
  "bk_qty_081" numeric,
  "bk_qty_082" numeric,
  "bk_qty_083" numeric,
  "bk_qty_084" numeric,
  "bk_qty_085" numeric,
  "bk_qty_086" numeric,
  "bk_qty_087" numeric,
  "bk_qty_088" numeric,
  "bk_qty_089" numeric,
  "bk_qty_090" numeric,
  "bk_qty_091" numeric,
  "bk_qty_092" numeric,
  "bk_qty_093" numeric,
  "bk_qty_094" numeric,
  "bk_qty_095" numeric,
  "bk_qty_096" numeric,
  "bk_qty_097" numeric,
  "bk_qty_098" numeric,
  "bk_qty_099" numeric,
  "bk_qty_100" numeric,
  "bk_qty_101" numeric,
  "bk_qty_102" numeric,
  "bk_qty_103" numeric,
  "bk_qty_104" numeric,
  "sum_qty_01" numeric,
  "sum_qty_02" numeric,
  "sum_qty_03" numeric,
  "sum_qty_04" numeric,
  "sum_qty_05" numeric,
  "sum_qty_06" numeric,
  "sum_qty_07" numeric,
  "sum_qty_08" numeric,
  "sum_qty_09" numeric,
  "sum_qty_10" numeric,
  "sum_qty_11" numeric,
  "sum_qty_12" numeric,
  "sum_qty_13" numeric,
  "sum_qty_14" numeric,
  "sum_qty_15" numeric,
  "sum_qty_16" numeric,
  "sum_qty_17" numeric,
  "sum_qty_18" numeric,
  "sum_qty_19" numeric,
  "sum_qty_20" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "dimensions" varchar(100) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."product_model_number" IS '产品型号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."mold_qty" IS '模具数量';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."uph" IS '日产能';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."supplier_inventory_qty" IS '供方库存数量';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."dimensions" IS '规格/尺寸';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_mold_supply_bucket_data" IS '物料模具供应能力分析';

-- ----------------------------
-- Table structure for scp_material_mold_supply_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_mold_supply_planning_item";
CREATE TABLE "themetis_scp"."scp_material_mold_supply_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_mold_supply_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default",
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "material_group_code" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "material_category_lv1" varchar COLLATE "pg_catalog"."default",
  "material_category_lv2" varchar COLLATE "pg_catalog"."default",
  "material_category_lv3" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default",
  "buyer_id" varchar(100) COLLATE "pg_catalog"."default",
  "remarks" varchar COLLATE "pg_catalog"."default",
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default",
  "aggregated_type" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."id" IS '主键，自动生成的序列号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."demand_unit_code" IS '需求计划单元(市场)';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."material" IS '物料(模具编码)';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."material_group_code" IS '物料分组号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."material_category_lv1" IS '物料大类';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."material_category_lv2" IS '物料中类';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."material_category_lv3" IS '物料小类';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."buyer_id" IS '采购员 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."remarks" IS '备注，评审结论';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."customer_no" IS '客户编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."contract_no" IS '合同编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."supplier_no" IS '供应商编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr01" IS '预留字段 01';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr02" IS '预留字段 11--产品型号/机型(生产版本)';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr03" IS 'BOMID_版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr04" IS '物料描述（模具名称）';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr05" IS '剩余模次';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr06" IS '供方';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr07" IS '模制件';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr08" IS '模制件物料描述';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr09" IS '图号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr10" IS '模具名称';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr11" IS '预留字段 11';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr12" IS '预留字段 12';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr13" IS '预留字段 13';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr14" IS '预留字段 14';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr15" IS '预留字段 15';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr16" IS '预留字段 16';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr17" IS '预留字段 17';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr18" IS '预留字段 18';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr19" IS '预留字段 19';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr20" IS '预留字段 20';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr21" IS '预留时间戳字段 21';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr22" IS '预留时间戳字段 22';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr23" IS '预留时间戳字段 23';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr24" IS '预留时间戳字段 24';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr25" IS '预留时间戳字段 25';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr26" IS '预留数值字段 26，精度 20，小数位 6--模具数';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr27" IS '预留数值字段 27，精度 20，小数位 6--日产能';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr28" IS '预留数值字段 28，精度 20，小数位 6--供方库存';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr29" IS '预留数值字段 29，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."meta_attr30" IS '预留数值字段 30，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."creation_date" IS '创建日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."last_update_date" IS '最后更新日期';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."created_by" IS '创建人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."last_updated_by" IS '最后更新人 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."tenant_id" IS '租户 ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_mold_supply_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_material_mold_supply_planning_item" IS '物料模具供应能力分析';

-- ----------------------------
-- Table structure for scp_material_planning_attribute
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_material_planning_attribute";
CREATE TABLE "themetis_scp"."scp_material_planning_attribute" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_planning_attribute_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "buyer_id" int8,
  "purchase_category_id" varchar(100) COLLATE "pg_catalog"."default",
  "critical_flag" bool DEFAULT true,
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "lead_time" numeric(20,6),
  "planning_figure" varchar(100) COLLATE "pg_catalog"."default",
  "material_category_lv1" varchar(100) COLLATE "pg_catalog"."default",
  "material_category_lv2" varchar(100) COLLATE "pg_catalog"."default",
  "material_category_lv3" varchar(100) COLLATE "pg_catalog"."default",
  "material_category_lv4" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "atp_calc_flag" bool,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."supply_unit_code" IS '供应计划单元;计划工厂';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."buyer_id" IS '采购员用户ID';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."purchase_category_id" IS '采购物品分类ID;采购组';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."critical_flag" IS '关键物料标识;评审物料标识';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."lead_time" IS '采购周期';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."planning_figure" IS '计划维度';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."material_category_lv1" IS '物料大类';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."material_category_lv2" IS '物料中类';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."material_category_lv3" IS '物料小类';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."material_category_lv4" IS '物料细类';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."atp_calc_flag" IS '是否参与ATP运算';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_material_planning_attribute"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_mds_analysis_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mds_analysis_bucket_data";
CREATE TABLE "themetis_scp"."scp_mds_analysis_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mds_analysis_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mds_analysis_bucket_data" IS '主需求计划数据';

-- ----------------------------
-- Table structure for scp_mds_analysis_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mds_analysis_planning_item";
CREATE TABLE "themetis_scp"."scp_mds_analysis_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mds_analysis_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_analysis_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mds_analysis_planning_item" IS '主需求计划对象数据';

-- ----------------------------
-- Table structure for scp_mds_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mds_bucket_data";
CREATE TABLE "themetis_scp"."scp_mds_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mds_bucket_data_id_seq2'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mds_bucket_data"."supply_center_code" IS '供应中心';
COMMENT ON TABLE "themetis_scp"."scp_mds_bucket_data" IS '主需求计划数据';

-- ----------------------------
-- Table structure for scp_mds_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mds_planning_item";
CREATE TABLE "themetis_scp"."scp_mds_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mds_planning_item_id_seq1'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mds_planning_item" IS '主需求计划对象数据';

-- ----------------------------
-- Table structure for scp_mds_sim_priority
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mds_sim_priority";
CREATE TABLE "themetis_scp"."scp_mds_sim_priority" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mds_sim_priority_id_seq'::regclass),
  "original_demand_order_line_id" int8 NOT NULL,
  "demand_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "required_quantity" numeric(20,6) NOT NULL,
  "original_required_quantity" numeric(20,6) NOT NULL,
  "request_date" timestamp(6) NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_type" varchar(50) COLLATE "pg_catalog"."default",
  "demand_bucket_start_date" timestamp(6) NOT NULL,
  "demand_bucket_end_date" timestamp(6) NOT NULL,
  "original_demand_priority" int8,
  "sim_demand_priority" int8,
  "original_request_ship_date" timestamp(6),
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "order_setup_type" varchar(30) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."original_demand_order_line_id" IS '源系统订单行ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."demand_order_no" IS '需求订单号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."supply_unit_code" IS '供应计划单元，外键：in_plan_unit.plan_unit';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."demand_order_line_no" IS '需求行号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."required_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."original_required_quantity" IS '原需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."request_date" IS '需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."material_revision" IS '需求版本';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."demand_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."demand_bucket_start_date" IS '预测需求开始时间';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."demand_bucket_end_date" IS '预测需求结束时间';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."original_demand_priority" IS '优先级';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."sim_demand_priority" IS '优先级';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."original_request_ship_date" IS '原始需求时间，来自客户订单原始需求';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."customer_no" IS '客户号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."project_code" IS '项目号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."supplier_no" IS '供应商号，针对分供应商计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."production_delivery_method" IS '生产交付模式，ETO，MTO，MTS（默认）';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_sim_priority"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mds_sim_priority" IS '需求优先级模拟';

-- ----------------------------
-- Table structure for scp_mds_waterfall_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mds_waterfall_data";
CREATE TABLE "themetis_scp"."scp_mds_waterfall_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mds_waterfall_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."compare_planning_period_type_code" IS 'waterfall比较期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."compare_planning_period_code" IS 'waterfall比较期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mds_waterfall_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mds_waterfall_data" IS '主需求计划数据';

-- ----------------------------
-- Table structure for scp_mfd_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mfd_bucket_data";
CREATE TABLE "themetis_scp"."scp_mfd_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mfd_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "production_plan_driven_method" varchar(100) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."production_plan_driven_method" IS '生产计划驱动模式';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mfd_bucket_data" IS '天生产需求数据';

-- ----------------------------
-- Table structure for scp_mfd_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mfd_planning_item";
CREATE TABLE "themetis_scp"."scp_mfd_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mfd_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "production_plan_driven_method" varchar(100) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."production_plan_driven_method" IS '生产计划驱动模式';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfd_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mfd_planning_item" IS '天生产需求';

-- ----------------------------
-- Table structure for scp_mfp_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mfp_bucket_data";
CREATE TABLE "themetis_scp"."scp_mfp_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mfp_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "constraint_type" varchar(100) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."constraint_type" IS '约束类型：物料齐套,产能约束';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mfp_bucket_data" IS '天生产计划数据';

-- ----------------------------
-- Table structure for scp_mfp_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mfp_planning_item";
CREATE TABLE "themetis_scp"."scp_mfp_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mfp_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "constraint_type" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."constraint_type" IS '约束类型：物料齐套,产能约束';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mfp_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mfp_planning_item" IS '天生产计划数据';

-- ----------------------------
-- Table structure for scp_mps_analysis_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mps_analysis_bucket_data";
CREATE TABLE "themetis_scp"."scp_mps_analysis_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mps_analysis_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mps_analysis_bucket_data" IS '主计划计划数据';

-- ----------------------------
-- Table structure for scp_mps_analysis_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mps_analysis_planning_item";
CREATE TABLE "themetis_scp"."scp_mps_analysis_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mps_analysis_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_analysis_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mps_analysis_planning_item" IS '主计划计划对象数据';

-- ----------------------------
-- Table structure for scp_mps_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mps_bucket_data";
CREATE TABLE "themetis_scp"."scp_mps_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mps_bucket_data_id_seq1'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mps_bucket_data" IS '主计划计划数据';

-- ----------------------------
-- Table structure for scp_mps_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mps_planning_item";
CREATE TABLE "themetis_scp"."scp_mps_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mps_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "plan_focus_layer" varchar(50) COLLATE "pg_catalog"."default",
  "material_desc" varchar(1000) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."demand_unit_code" IS '需求计划单元（市场）';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr02" IS '分公司';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr03" IS '国家';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr04" IS '客户名称';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr05" IS '滚动计划号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr06" IS '品牌';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr07" IS '整机工厂编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr08" IS '整机工厂名称';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr09" IS '出口包装方式';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr10" IS '产品型号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr11" IS '产品规格属性';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."meta_attr12" IS '大区';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."plan_focus_layer" IS '计划关注层 (院调度,厂、所调度)';
COMMENT ON COLUMN "themetis_scp"."scp_mps_planning_item"."material_desc" IS '物料描述';
COMMENT ON TABLE "themetis_scp"."scp_mps_planning_item" IS '主计划计划对象数据';

-- ----------------------------
-- Table structure for scp_mps_waterfall_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mps_waterfall_data";
CREATE TABLE "themetis_scp"."scp_mps_waterfall_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mps_waterfall_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."compare_planning_period_type_code" IS 'waterfall比较期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."compare_planning_period_code" IS 'waterfall比较期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mps_waterfall_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mps_waterfall_data" IS '主计划计划数据';

-- ----------------------------
-- Table structure for scp_mrp_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mrp_bucket_data";
CREATE TABLE "themetis_scp"."scp_mrp_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mrp_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_mrp_bucket_data" IS '主计划计划数据';

-- ----------------------------
-- Table structure for scp_mrp_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_mrp_planning_item";
CREATE TABLE "themetis_scp"."scp_mrp_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_mrp_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "shortage_weeks" numeric,
  "redundancy_weeks" numeric,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "inventory_excess_weeks" numeric(20,6)
)
;
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."shortage_weeks" IS '欠料周数';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."redundancy_weeks" IS '冗余周数';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_mrp_planning_item"."inventory_excess_weeks" IS '冗余周数';
COMMENT ON TABLE "themetis_scp"."scp_mrp_planning_item" IS '主计划计划对象数据';

-- ----------------------------
-- Table structure for scp_planned_demand_fulfillment
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_demand_fulfillment";
CREATE TABLE "themetis_scp"."scp_planned_demand_fulfillment" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_demand_fulfillment_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_no" text COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_line_no" text COLLATE "pg_catalog"."default",
  "demand_order_material" text COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_material_revision" text COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_id" int8,
  "demand_order_line_id" int8,
  "demand_order_plan_line_id" int8,
  "parent_production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "parent_production_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_plan_line_id" varchar(100) COLLATE "pg_catalog"."default",
  "product_material" varchar(200) COLLATE "pg_catalog"."default",
  "mrp_request_date" timestamp(6),
  "ctp_request_date" timestamp(6),
  "mrp_require_quantity" numeric(20,6),
  "ctp_require_quantity" numeric(20,6),
  "material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "demand_revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "demand_attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "demand_order_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "demand_type" varchar(30) COLLATE "pg_catalog"."default",
  "mts_order_flag" bool DEFAULT false,
  "critical_flag" bool DEFAULT false,
  "demand_order_max_supply_date" timestamp(6),
  "substitution_material" varchar(200) COLLATE "pg_catalog"."default",
  "constraint_flag" bool DEFAULT false,
  "material_production_revision_no" varchar(100) COLLATE "pg_catalog"."default",
  "bom_no" varchar(100) COLLATE "pg_catalog"."default",
  "routing_no" varchar(100) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_lead_time" numeric(20,6),
  "material_distribution_path_no" varchar(100) COLLATE "pg_catalog"."default",
  "material_llc" int4,
  "substitution_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "total_supply_quantity" numeric(20,6),
  "latest_supply_date" timestamp(6),
  "purchase_order_quantity" numeric(20,6),
  "purchase_requisition_quantity" numeric(20,6),
  "production_order_quantity" numeric(20,6),
  "available_inventory_quantity" numeric(20,6),
  "distribution_order_quantity" numeric(20,6),
  "infinite_quantity" numeric(20,6),
  "planned_production_order_quantity" numeric(20,6),
  "planned_purchase_requisition_quantity" numeric(20,6),
  "planned_distribution_quantity" numeric(20,6),
  "substitution_quantity" numeric(20,6),
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_no" IS '顶层需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_line_no" IS '顶层需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_material" IS '顶层物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_material_revision" IS '顶层物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_id" IS '顶层需求ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_line_id" IS '顶层需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_plan_line_id" IS '拆分齐套能力后的需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."parent_production_order_no" IS '上层需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."parent_production_order_line_no" IS '上层需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."production_order_no" IS '需求工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."production_order_line_no" IS '需求工单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."production_order_plan_line_id" IS '拆分齐套能力后的上层需求工单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."product_material" IS '上层物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."mrp_request_date" IS '基于MRP倒推的需求时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."ctp_request_date" IS '基于供应能力卷积的供应时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."mrp_require_quantity" IS 'MRP需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."ctp_require_quantity" IS '拆分齐套能力后的需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_material_revision" IS '需求的物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_attribute_code" IS '需求属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_priority" IS '需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_unit_code" IS '根需求单号的计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."mts_order_flag" IS '是否MTS标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."critical_flag" IS '关键物料标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."demand_order_max_supply_date" IS '需求最大供应时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."substitution_material" IS '替代物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."constraint_flag" IS '约束标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."material_production_revision_no" IS '物料生产版本号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."bom_no" IS '生产BOM';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."routing_no" IS '生产工艺路线';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."operation_seq_no" IS '生产工序';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."production_lead_time" IS '生产周期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."material_distribution_path_no" IS '分销路径号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."material_llc" IS '物料低阶码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."substitution_group_code" IS '替代的成组码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."total_supply_quantity" IS '供应总量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."latest_supply_date" IS '供应最晚时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."purchase_order_quantity" IS '采购订单供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."purchase_requisition_quantity" IS '采购请求供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."production_order_quantity" IS '工单供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."available_inventory_quantity" IS '库存供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."distribution_order_quantity" IS '分销供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."infinite_quantity" IS '兜底数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."planned_production_order_quantity" IS '计划工单供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."planned_purchase_requisition_quantity" IS '计划采购供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."planned_distribution_quantity" IS '计划分销供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."substitution_quantity" IS '替代供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_planned_demand_fulfillment" IS '需求单履行';

-- ----------------------------
-- Table structure for scp_planned_demand_fulfillment_unit
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_demand_fulfillment_unit";
CREATE TABLE "themetis_scp"."scp_planned_demand_fulfillment_unit" (
  "id" int8 NOT NULL,
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "demand_plan_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_unit_lv1" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_unit_lv2" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_unit_lv3" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_unit_lv4" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_plan_line_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "product_hierarchy_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_lv1" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_lv2" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_lv3" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_lv4" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "bom_no" varchar(200) COLLATE "pg_catalog"."default",
  "demand_bucket_start_date" timestamp(6),
  "demand_bucket_end_date" timestamp(6),
  "required_quantity" numeric(20,6) NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_plan_priority" int8,
  "demand_priority_level" int4,
  "original_request_ship_date" timestamp(6),
  "project_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "order_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_plan_type" varchar(50) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "fulfillment_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "fulfillment_quantity" numeric(20,6) NOT NULL,
  "fulfillment_rate" numeric(20,6) NOT NULL,
  "path_priority" int8,
  "cost_rate" numeric(8,6),
  "logistics_leadtime" numeric(20,6),
  "effective_start_date" date,
  "effective_end_date" date,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "logistics_cost" numeric(8,6),
  "production_cost" numeric(8,6),
  "min_order_quantity" numeric(20,6),
  "error_type" varchar(40) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "error_message" varchar(400) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr01" varchar COLLATE "pg_catalog"."default",
  "meta_attr02" varchar COLLATE "pg_catalog"."default",
  "meta_attr03" varchar COLLATE "pg_catalog"."default",
  "meta_attr04" varchar COLLATE "pg_catalog"."default",
  "meta_attr05" varchar COLLATE "pg_catalog"."default",
  "meta_attr06" varchar COLLATE "pg_catalog"."default",
  "meta_attr07" varchar COLLATE "pg_catalog"."default",
  "meta_attr08" varchar COLLATE "pg_catalog"."default",
  "meta_attr09" varchar COLLATE "pg_catalog"."default",
  "meta_attr10" varchar COLLATE "pg_catalog"."default",
  "meta_attr11" varchar COLLATE "pg_catalog"."default",
  "meta_attr12" varchar COLLATE "pg_catalog"."default",
  "meta_attr13" varchar COLLATE "pg_catalog"."default",
  "meta_attr14" varchar COLLATE "pg_catalog"."default",
  "meta_attr15" varchar COLLATE "pg_catalog"."default",
  "meta_attr16" varchar COLLATE "pg_catalog"."default",
  "meta_attr17" varchar COLLATE "pg_catalog"."default",
  "meta_attr18" varchar COLLATE "pg_catalog"."default",
  "meta_attr19" varchar COLLATE "pg_catalog"."default",
  "meta_attr20" varchar COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric,
  "meta_attr27" numeric,
  "meta_attr28" numeric,
  "meta_attr29" numeric,
  "meta_attr30" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_plan_no" IS '预测单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_unit_code" IS '需求组织';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_unit_lv1" IS '需求计划单元lv1';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_unit_lv2" IS '需求计划单元lv2';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_unit_lv3" IS '需求计划单元lv3';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_unit_lv4" IS '需求计划单元lv4';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_plan_line_no" IS '预测单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_category_code" IS '产品目录编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_category_lv1" IS '产品目录lv1';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_category_lv2" IS '产品目录lv2';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_category_lv3" IS '产品目录lv3';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_category_lv4" IS '产品目录lv4';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."bom_no" IS 'BOM号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_bucket_start_date" IS '需求开始时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_bucket_end_date" IS '需求结束时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."required_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."attribute_code" IS '属性';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_plan_priority" IS '需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."original_request_ship_date" IS '原要求发货日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."order_no" IS '订单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."customer_no" IS '客户号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."demand_plan_type" IS '需求计划类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."fulfillment_unit_code" IS '履行计划工厂';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."fulfillment_quantity" IS '履行数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."fulfillment_rate" IS '履行比例';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."path_priority" IS '路径优先级';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."cost_rate" IS '成本系数';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."logistics_leadtime" IS '物流周期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."effective_start_date" IS '生效日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."effective_end_date" IS '失效日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."supply_center_code" IS '供应中心';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."logistics_cost" IS '物流成本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."production_cost" IS '生产成本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."min_order_quantity" IS '最小下单量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."error_message" IS '错误信息';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment_unit"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_planned_demand_fulfillment20250307
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_demand_fulfillment20250307";
CREATE TABLE "themetis_scp"."scp_planned_demand_fulfillment20250307" (
  "id" int8,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_no" text COLLATE "pg_catalog"."default",
  "demand_order_line_no" text COLLATE "pg_catalog"."default",
  "demand_order_material" text COLLATE "pg_catalog"."default",
  "demand_order_material_revision" text COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_id" int8,
  "demand_order_line_id" int8,
  "demand_order_plan_line_id" int8,
  "parent_production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "parent_production_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_plan_line_id" varchar(100) COLLATE "pg_catalog"."default",
  "product_material" varchar(200) COLLATE "pg_catalog"."default",
  "mrp_request_date" timestamp(6),
  "ctp_request_date" timestamp(6),
  "mrp_require_quantity" numeric(20,6),
  "ctp_require_quantity" numeric(20,6),
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "demand_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "demand_revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "demand_attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "demand_order_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "demand_type" varchar(30) COLLATE "pg_catalog"."default",
  "mts_order_flag" bool,
  "critical_flag" bool,
  "demand_order_max_supply_date" timestamp(6),
  "substitution_material" varchar(200) COLLATE "pg_catalog"."default",
  "constraint_flag" bool,
  "material_production_revision_no" varchar(100) COLLATE "pg_catalog"."default",
  "bom_no" varchar(100) COLLATE "pg_catalog"."default",
  "routing_no" varchar(100) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_lead_time" numeric(20,6),
  "material_distribution_path_no" varchar(100) COLLATE "pg_catalog"."default",
  "material_llc" int4,
  "substitution_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "total_supply_quantity" numeric(20,6),
  "latest_supply_date" timestamp(6),
  "purchase_order_quantity" numeric(20,6),
  "purchase_requisition_quantity" numeric(20,6),
  "production_order_quantity" numeric(20,6),
  "available_inventory_quantity" numeric(20,6),
  "distribution_order_quantity" numeric(20,6),
  "infinite_quantity" numeric(20,6),
  "planned_production_order_quantity" numeric(20,6),
  "planned_purchase_requisition_quantity" numeric(20,6),
  "planned_distribution_quantity" numeric(20,6),
  "substitution_quantity" numeric(20,6),
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment20250307"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment20250307"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment20250307"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_fulfillment20250307"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_planned_demand_order
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_demand_order";
CREATE TABLE "themetis_scp"."scp_planned_demand_order" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_demand_order_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_id" int8,
  "demand_order_line_id" int8,
  "demand_order_plan_line_id" int8,
  "mrp_request_date" timestamp(6),
  "latest_supply_date" timestamp(6),
  "mrp_require_quantity" numeric(20,6),
  "ontime_supply_quantity" numeric(20,6),
  "demand_revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "demand_attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "demand_type" varchar(30) COLLATE "pg_catalog"."default",
  "mts_order_flag" bool DEFAULT false,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_order_no" IS '需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_order_line_no" IS '需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_order_material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_order_material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_order_id" IS '需求ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_order_line_id" IS '需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_order_plan_line_id" IS '拆分齐套能力后的需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."mrp_request_date" IS '需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."latest_supply_date" IS '供应最晚时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."mrp_require_quantity" IS 'MRP需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."ontime_supply_quantity" IS '按需求时间供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_attribute_code" IS '需求属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_priority" IS '需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."demand_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."mts_order_flag" IS '是否MTS标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_demand_order"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON TABLE "themetis_scp"."scp_planned_demand_order" IS '需求单头';

-- ----------------------------
-- Table structure for scp_planned_demand_order20250307
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_demand_order20250307";
CREATE TABLE "themetis_scp"."scp_planned_demand_order20250307" (
  "id" int8,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default",
  "demand_order_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_id" int8,
  "demand_order_line_id" int8,
  "demand_order_plan_line_id" int8,
  "mrp_request_date" timestamp(6),
  "latest_supply_date" timestamp(6),
  "mrp_require_quantity" numeric(20,6),
  "ontime_supply_quantity" numeric(20,6),
  "demand_revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "demand_attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "demand_type" varchar(30) COLLATE "pg_catalog"."default",
  "mts_order_flag" bool,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default"
)
;

-- ----------------------------
-- Table structure for scp_planned_distribution_order
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_distribution_order";
CREATE TABLE "themetis_scp"."scp_planned_distribution_order" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_distribution_order_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "distribution_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "material_distribution_path_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "mrp_planned_shipping_date" timestamp(6),
  "mrp_planned_arrival_date" timestamp(6),
  "adj_planned_shipping_date" timestamp(6),
  "distribution_lead_time" numeric(20,6),
  "ctp_planned_shipping_date" timestamp(6),
  "ctp_planned_arrival_date" timestamp(6),
  "planned_quantity" numeric(20,6),
  "adj_planned_quantity" numeric(20,6),
  "distribution_type" varchar(50) COLLATE "pg_catalog"."default",
  "distribution_priority" int8,
  "distribution_ratio" numeric(8,6),
  "consolidation_days" int4,
  "consolidation_bucket_start_date" timestamp(6),
  "consolidation_bucket_end_date" timestamp(6),
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "data_source_type" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "transfer_order_type" varchar(100) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "supply_material_start_date" timestamp(6),
  "supply_material_end_date" timestamp(6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "erp_sto_no" varchar COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "error_message" varchar(1000) COLLATE "pg_catalog"."default",
  "lot_number" varchar(100) COLLATE "pg_catalog"."default",
  "group_number" varchar(100) COLLATE "pg_catalog"."default",
  "sy_production_order_no" varchar(200) COLLATE "pg_catalog"."default",
  "model_production_order_no" varchar(200) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."distribution_order_no" IS '计划分销订单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."material_distribution_path_no" IS '分销路径号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."attribute_code" IS '物料属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."mrp_planned_shipping_date" IS 'MRP推导的起运日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."mrp_planned_arrival_date" IS 'MRP推导的到达日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."adj_planned_shipping_date" IS '调整后要求发货日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."distribution_lead_time" IS '运输周期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."ctp_planned_shipping_date" IS 'CTP能力约束下的起运日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."ctp_planned_arrival_date" IS 'CTP能力约束下的到货日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."planned_quantity" IS '计划转运数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."adj_planned_quantity" IS '调整后转运数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."distribution_type" IS '分销类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."distribution_priority" IS '分销优先级';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."distribution_ratio" IS '分销比例';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."consolidation_bucket_start_date" IS '固定供应时段起点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."consolidation_bucket_end_date" IS '固定供应时段终点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."remarks" IS '备注';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."data_source_type" IS '数据来源类型：ENGINE,MANUAL';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."transfer_order_type" IS '调拨类型(跨法人调拨/工厂间调拨/工厂内调拨)，用lookup=transfer_order_type配置';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."production_delivery_method" IS '生产交付方式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."erp_sto_no" IS 'erp sto 单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."interface_status" IS '接口状态，0失败 1成功';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."error_message" IS '接口返回信息';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."lot_number" IS '批号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."group_number" IS '组号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."sy_production_order_no" IS 'sy交接单号，前缀DIST';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."model_production_order_no" IS '型号工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."demand_order_no" IS '顶层需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_distribution_order"."demand_order_line_no" IS '顶层需求行号';
COMMENT ON TABLE "themetis_scp"."scp_planned_distribution_order" IS '分销计划';

-- ----------------------------
-- Table structure for scp_planned_production_order
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_production_order";
CREATE TABLE "themetis_scp"."scp_planned_production_order" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_production_order_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar COLLATE "pg_catalog"."default",
  "total_planned_quantity" numeric,
  "mrp_planned_start_date" timestamp(6),
  "mrp_planned_end_date" timestamp(6),
  "supply_material_start_date" timestamp(6),
  "supply_material_end_date" timestamp(6),
  "ctp_planned_start_date" timestamp(6),
  "ctp_planned_end_date" timestamp(6),
  "consolidation_days" int4,
  "mrp_consolidation_bucket_start_date" timestamp(6),
  "mrp_consolidation_bucket_end_date" timestamp(6),
  "ctp_consolidation_bucket_start_date" timestamp(6),
  "ctp_consolidation_bucket_end_date" timestamp(6),
  "material_production_version_no" varchar COLLATE "pg_catalog"."default",
  "bom_no" varchar COLLATE "pg_catalog"."default",
  "routing_no" varchar COLLATE "pg_catalog"."default",
  "production_shift" varchar COLLATE "pg_catalog"."default",
  "production_setup_type" varchar COLLATE "pg_catalog"."default",
  "production_rate" numeric,
  "status" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "full_kitting_flag" bool,
  "parent_product_material" text COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "parent_production_order_no" text COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "parent_production_order_line_no" text COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "order_type" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "erp_wip_id" varchar COLLATE "pg_catalog"."default",
  "erp_wip_no" varchar COLLATE "pg_catalog"."default",
  "erp_wip_status" varchar COLLATE "pg_catalog"."default",
  "erp_wip_completed_qty" int4,
  "erp_wip_completed_date" date,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "remarks" varchar COLLATE "pg_catalog"."default",
  "production_order_class" varchar COLLATE "pg_catalog"."default",
  "planning_time_fence_flag" bool DEFAULT false,
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar COLLATE "pg_catalog"."default",
  "release_time_fence_flag" bool,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "error_message" varchar(1000) COLLATE "pg_catalog"."default",
  "model_production_order_no" varchar COLLATE "pg_catalog"."default",
  "lot_number" varchar(100) COLLATE "pg_catalog"."default",
  "group_number" varchar(100) COLLATE "pg_catalog"."default",
  "sy_production_order_no" varchar(200) COLLATE "pg_catalog"."default",
  "excess_flag" bool,
  "excess_qty" bool
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."total_planned_quantity" IS '总的数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."mrp_planned_start_date" IS '基于MRP计算的开工时间(要求开工时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."mrp_planned_end_date" IS '基于MRP计算的完工时间(要求完工时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."supply_material_start_date" IS '物料齐套开工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."supply_material_end_date" IS '物料齐套开工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."ctp_planned_start_date" IS '基于能力约束的开工时间(计划开工时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."ctp_planned_end_date" IS '基于能力约束的完工时间(计划完工时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."mrp_consolidation_bucket_start_date" IS 'MRP固定供应时段开始时间(计划合并开始时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."mrp_consolidation_bucket_end_date" IS 'MRP固定供应时段结束时间(计划合并结束时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."ctp_consolidation_bucket_start_date" IS 'CTP固定供应时段开始时间(约束合并开始时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."ctp_consolidation_bucket_end_date" IS 'CTP固定供应时段结束时间(约束合并结束时间)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."material_production_version_no" IS '生产版本号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."bom_no" IS 'BOM号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."routing_no" IS '工艺路径号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."production_shift" IS '生产班次';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."production_setup_type" IS '生产准备类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."production_rate" IS '生产产出率';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."status" IS ' 状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."full_kitting_flag" IS '物料齐套标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."parent_product_material" IS '父项生产的物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."demand_order_no" IS '顶层需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."demand_order_line_no" IS '顶层需求行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."parent_production_order_no" IS '上层需求工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."parent_production_order_line_no" IS '上层需求工单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."order_type" IS '工单类型MFG/PRODUCTION_ORDER';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."erp_wip_id" IS 'ERP工单ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."erp_wip_no" IS 'ERP工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."erp_wip_status" IS 'ERP工单状态';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."erp_wip_completed_qty" IS 'ERP工单完工数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."erp_wip_completed_date" IS 'ERP工单完工日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."remarks" IS '备注';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."production_order_class" IS '生产工单类型，下拉列表值从Lookup中获取；标准/非标类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."planning_time_fence_flag" IS '是否计划时间栏内';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."production_delivery_method" IS '生产交付方式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."release_time_fence_flag" IS '是否释放周期内';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."interface_status" IS '接口状态，0失败 1成功';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."error_message" IS '接口返回信息';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."model_production_order_no" IS '型号生产工单';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."lot_number" IS '批号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."group_number" IS '组号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."sy_production_order_no" IS '新工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."excess_flag" IS '冗余标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order"."excess_qty" IS '冗余数量';
COMMENT ON TABLE "themetis_scp"."scp_planned_production_order" IS '生产计划工单';

-- ----------------------------
-- Table structure for scp_planned_production_order_component
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_production_order_component";
CREATE TABLE "themetis_scp"."scp_planned_production_order_component" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_production_order_component_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "total_required_quantity" numeric(20,6),
  "reserved_quantity" numeric(20,6),
  "planned_quantity" numeric(20,6),
  "available_inventory_quantity" numeric(20,6),
  "inventory_supply_quantity" numeric(20,6),
  "mrp_supply_quantity" numeric(20,6),
  "material_supply_date" timestamp(6),
  "material_production_rate" numeric(8,6),
  "original_material" varchar(200) COLLATE "pg_catalog"."default",
  "original_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "production_supply_type" varchar(30) COLLATE "pg_catalog"."default",
  "bom_component_no" varchar(100) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "remarks" varchar(200) COLLATE "pg_catalog"."default",
  "material_issue_method" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "model_production_order_no" varchar(200) COLLATE "pg_catalog"."default",
  "sy_production_order_no" varchar(200) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."production_order_line_no" IS '生产工单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."material" IS '组件物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."attribute_code" IS '组件属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."total_required_quantity" IS '总需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."reserved_quantity" IS '已预留数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."planned_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."available_inventory_quantity" IS '可用库存数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."inventory_supply_quantity" IS '库存供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."mrp_supply_quantity" IS '满足mrp需求的供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."material_supply_date" IS '物料最早齐套时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."material_production_rate" IS '物料良率';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."original_material" IS '替代前原物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."original_material_revision" IS '原物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."production_supply_type" IS '生产供应类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."bom_component_no" IS 'BOM行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."remarks" IS '备注';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."material_issue_method" IS '物料发料方式，拉式发料PULL、推式发料PUSH、SUPPLIER供应商发料、BULK大量领用、PH虚拟发料、BACKFLUSH倒冲，从lookup中获取';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."model_production_order_no" IS '型号工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_component"."sy_production_order_no" IS '新工单号';
COMMENT ON TABLE "themetis_scp"."scp_planned_production_order_component" IS '生产计划工单物料行';

-- ----------------------------
-- Table structure for scp_planned_production_order_operation
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_production_order_operation";
CREATE TABLE "themetis_scp"."scp_planned_production_order_operation" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_production_order_operation_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "mrp_operation_start_date" timestamp(6),
  "mrp_operation_end_date" timestamp(6),
  "supply_material_start_date" timestamp(6),
  "supply_material_end_date" timestamp(6),
  "mrp_start_bucket_no" varchar(100) COLLATE "pg_catalog"."default",
  "mrp_end_bucket_no" varchar(100) COLLATE "pg_catalog"."default",
  "ctp_operation_start_date" timestamp(6),
  "ctp_operation_end_date" timestamp(6),
  "ctp_start_bucket_no" varchar(100) COLLATE "pg_catalog"."default",
  "ctp_end_bucket_no" varchar(100) COLLATE "pg_catalog"."default",
  "planned_production_quantity" numeric(20,6),
  "planned_produced_quantity" numeric(20,6),
  "preparation_lead_time" numeric(20,6),
  "fix_lead_time" varchar(100) COLLATE "pg_catalog"."default",
  "unit_lead_time" varchar(100) COLLATE "pg_catalog"."default",
  "waiting_lead_time" varchar(100) COLLATE "pg_catalog"."default",
  "next_operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "operation_setup_type" varchar(30) COLLATE "pg_catalog"."default",
  "transfer_batch" int4,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "out_source_flag" bool,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "model_production_order_no" varchar COLLATE "pg_catalog"."default",
  "sy_production_order_no" varchar(200) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."mrp_operation_start_date" IS '基于MRP计算的工序开工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."mrp_operation_end_date" IS '基于MRP计算的工序完工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."supply_material_start_date" IS '供应物料开始时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."supply_material_end_date" IS '供应物料结束时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."mrp_start_bucket_no" IS '基于MRP计算的开工计划时段单号，工序开工的bucket号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."mrp_end_bucket_no" IS '基于MRP计算的完工计划时段单号，工序完工的bucket号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."ctp_operation_start_date" IS '基于能力约束的工序开工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."ctp_operation_end_date" IS '基于能力约束的工序完工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."ctp_start_bucket_no" IS '基于能力约束的开工计划时段单号，工序开工的bucket号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."ctp_end_bucket_no" IS '基于能力约束的完工计划时段单号，工序完工的bucket号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."planned_production_quantity" IS '计划加工数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."planned_produced_quantity" IS '计划产出数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."preparation_lead_time" IS '工序前准备时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."fix_lead_time" IS '固定加工周期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."unit_lead_time" IS '单位加工周期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."waiting_lead_time" IS '等待加工周期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."next_operation_seq_no" IS '下一道工序号，用于表示工序之间连接关系，支持树状工艺路线';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."attribute_code" IS '资源属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."operation_setup_type" IS '工序准备类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."transfer_batch" IS '转移批量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."out_source_flag" IS '外协标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."model_production_order_no" IS '型号生产工单';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_operation"."sy_production_order_no" IS '新工单号';
COMMENT ON TABLE "themetis_scp"."scp_planned_production_order_operation" IS '生产计划工单工序行';

-- ----------------------------
-- Table structure for scp_planned_production_order_outsource
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_production_order_outsource";
CREATE TABLE "themetis_scp"."scp_planned_production_order_outsource" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_production_order_outsource_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "erp_pr_no" varchar(100) COLLATE "pg_catalog"."default",
  "erp_pr_header_id" varchar(100) COLLATE "pg_catalog"."default",
  "erp_pr_line_id" varchar(100) COLLATE "pg_catalog"."default",
  "erp_pr_status" varchar(100) COLLATE "pg_catalog"."default",
  "erp_po_header_id" varchar(100) COLLATE "pg_catalog"."default",
  "erp_po_line_id" varchar(100) COLLATE "pg_catalog"."default",
  "erp_po_shipment_line_id" varchar(100) COLLATE "pg_catalog"."default",
  "erp_po_status" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."resource_no" IS '资源编号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."supplier_no" IS '供应商编号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_pr_no" IS 'erp pr 单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_pr_header_id" IS 'erp pr header id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_pr_line_id" IS 'erp pr line_id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_pr_status" IS 'erp pr状态';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_po_header_id" IS 'erp po header id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_po_line_id" IS 'erp po line id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_po_shipment_line_id" IS 'erp po shipment line id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_outsource"."erp_po_status" IS 'erp po状态';
COMMENT ON TABLE "themetis_scp"."scp_planned_production_order_outsource" IS '生产计划工单外协采购信息';

-- ----------------------------
-- Table structure for scp_planned_production_order_product
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_production_order_product";
CREATE TABLE "themetis_scp"."scp_planned_production_order_product" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_production_order_product_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_product_no" varchar(100) COLLATE "pg_catalog"."default",
  "product_material" varchar(200) COLLATE "pg_catalog"."default",
  "product_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "planned_quantity" numeric(20,6),
  "planned_quantity_ratio" numeric(8,6),
  "product_type" varchar(30) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "model_production_order_no" varchar COLLATE "pg_catalog"."default",
  "sy_production_order_no" varchar(200) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."production_order_product_no" IS '工单产出号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."product_material" IS '生产产成品';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."product_material_revision" IS '产成品物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."attribute_code" IS '物料属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."planned_quantity" IS '产出数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."planned_quantity_ratio" IS '产出数量比例';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."product_type" IS '产品类型：Primary_Product：主产品/Co_Porduct：联产品/By_Product：副产品；工单所有产出产品中，必须有一个Primary产品，根据主产品来选择生产方案';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."model_production_order_no" IS '型号生产工单';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_product"."sy_production_order_no" IS '新工单号';
COMMENT ON TABLE "themetis_scp"."scp_planned_production_order_product" IS '生产计划工单成品行';

-- ----------------------------
-- Table structure for scp_planned_production_order_report
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_production_order_report";
CREATE TABLE "themetis_scp"."scp_planned_production_order_report" (
  "id" int8 NOT NULL DEFAULT nextval('themetis_data.scp_planned_production_order_report_id_seq'::regclass),
  "model_production_order_no" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_code" varchar(100) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(100) COLLATE "pg_catalog"."default",
  "kit_number" varchar(100) COLLATE "pg_catalog"."default",
  "phase_no" varchar(100) COLLATE "pg_catalog"."default",
  "product_flag" varchar(100) COLLATE "pg_catalog"."default",
  "completed_quantity" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "logistics_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "completed_date" timestamp(6),
  "integration_date" timestamp(6),
  "created_by" int4,
  "creation_date" timestamp(6),
  "last_updated_by" int4,
  "last_update_date" timestamp(6),
  "demand_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(100) COLLATE "pg_catalog"."default",
  "tenant_id" int8,
  "lot_number" varchar(100) COLLATE "pg_catalog"."default",
  "group_number" varchar(100) COLLATE "pg_catalog"."default",
  "sy_production_order_no" varchar(200) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."model_production_order_no" IS '型号工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."kit_number" IS '台份号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."completed_quantity" IS '完工数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."logistics_id" IS '物流跟踪系统唯一标识';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."completed_date" IS '集成时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."integration_date" IS '完工时间(扫码）';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."created_by" IS '创建人';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."creation_date" IS '创建时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."last_updated_by" IS '最后更新人';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."last_update_date" IS '最后更新时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."demand_order_no" IS '需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."demand_order_line_no" IS '需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."supply_unit_code" IS '计划工厂';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."lot_number" IS '批次';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."group_number" IS '组次';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_report"."sy_production_order_no" IS '新工单号';
COMMENT ON TABLE "themetis_scp"."scp_planned_production_order_report" IS '工单报工表';

-- ----------------------------
-- Table structure for scp_planned_production_order_resource
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_production_order_resource";
CREATE TABLE "themetis_scp"."scp_planned_production_order_resource" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_production_order_resource_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "operation_start_date" timestamp(6),
  "operation_end_date" timestamp(6),
  "consumed_capacity" numeric(20,6),
  "fixed_lead_time" numeric(20,6),
  "waiting_lead_time" numeric(20,6),
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "operation_setup_type" varchar(30) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "model_production_order_no" varchar COLLATE "pg_catalog"."default",
  "sy_production_order_no" varchar(200) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."resource_no" IS '资源编号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."operation_start_date" IS '工序开工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."operation_end_date" IS '工序完工时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."consumed_capacity" IS '消耗产能';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."fixed_lead_time" IS '固定生产周期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."waiting_lead_time" IS '等待时长，不占用资源';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."attribute_code" IS '资源属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."operation_setup_type" IS '工序准备类型';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."model_production_order_no" IS '型号生产工单';
COMMENT ON COLUMN "themetis_scp"."scp_planned_production_order_resource"."sy_production_order_no" IS '新工单号';
COMMENT ON TABLE "themetis_scp"."scp_planned_production_order_resource" IS '生产计划工单资源行';

-- ----------------------------
-- Table structure for scp_planned_purchase_order_bak_20250521
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_purchase_order_bak_20250521";
CREATE TABLE "themetis_scp"."scp_planned_purchase_order_bak_20250521" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_purchase_order_id_seq1'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planned_purchase_order_no" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planned_quantity" numeric NOT NULL,
  "mrp_request_date" timestamp(6) NOT NULL,
  "ctp_request_date" timestamp(6),
  "mrp_arrival_date" timestamp(6),
  "ctp_arrival_date" timestamp(6),
  "mrp_release_date" timestamp(6),
  "ctp_release_date" timestamp(6),
  "mrp_consolidation_bucket_start_date" timestamp(6),
  "mrp_consolidation_bucket_end_date" timestamp(6),
  "ctp_consolidation_bucket_start_date" timestamp(6),
  "ctp_consolidation_bucket_end_date" timestamp(6),
  "product_material" varchar COLLATE "pg_catalog"."default",
  "demand_order_no" text COLLATE "pg_catalog"."default",
  "demand_order_line_no" text COLLATE "pg_catalog"."default",
  "production_order_no" text COLLATE "pg_catalog"."default",
  "production_order_line_no" text COLLATE "pg_catalog"."default",
  "warehouse_no" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "data_source_type" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar COLLATE "pg_catalog"."default",
  "erp_pr_no" varchar COLLATE "pg_catalog"."default",
  "erp_pr_header_id" varchar COLLATE "pg_catalog"."default",
  "erp_pr_line_id" varchar COLLATE "pg_catalog"."default",
  "erp_pr_status" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar COLLATE "pg_catalog"."default",
  "meta_attr02" varchar COLLATE "pg_catalog"."default",
  "meta_attr03" varchar COLLATE "pg_catalog"."default",
  "meta_attr04" varchar COLLATE "pg_catalog"."default",
  "meta_attr05" varchar COLLATE "pg_catalog"."default",
  "meta_attr06" varchar COLLATE "pg_catalog"."default",
  "meta_attr07" varchar COLLATE "pg_catalog"."default",
  "meta_attr08" varchar COLLATE "pg_catalog"."default",
  "meta_attr09" varchar COLLATE "pg_catalog"."default",
  "meta_attr10" varchar COLLATE "pg_catalog"."default",
  "meta_attr11" varchar COLLATE "pg_catalog"."default",
  "meta_attr12" varchar COLLATE "pg_catalog"."default",
  "meta_attr13" varchar COLLATE "pg_catalog"."default",
  "meta_attr14" varchar COLLATE "pg_catalog"."default",
  "meta_attr15" varchar COLLATE "pg_catalog"."default",
  "meta_attr16" varchar COLLATE "pg_catalog"."default",
  "meta_attr17" varchar COLLATE "pg_catalog"."default",
  "meta_attr18" varchar COLLATE "pg_catalog"."default",
  "meta_attr19" varchar COLLATE "pg_catalog"."default",
  "meta_attr20" varchar COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric,
  "meta_attr27" numeric,
  "meta_attr28" numeric,
  "meta_attr29" numeric,
  "meta_attr30" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "production_material_request_date" timestamp(6),
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6)
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."planned_purchase_order_no" IS '计划订单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."planned_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."mrp_request_date" IS '无约束分解的需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."ctp_request_date" IS '约束齐套的需求时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."mrp_arrival_date" IS 'MRP分解的到货日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."ctp_arrival_date" IS 'CTP齐套的到货日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."mrp_release_date" IS 'MRP分解的下达日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."ctp_release_date" IS 'CTP齐套的下达日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."mrp_consolidation_bucket_start_date" IS 'MRP固定供应起点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."mrp_consolidation_bucket_end_date" IS 'MRP固定供应终点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."ctp_consolidation_bucket_start_date" IS 'CTP固定供应起点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."ctp_consolidation_bucket_end_date" IS 'CTP固定供应终点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."product_material" IS '父项生产的物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."demand_order_no" IS '顶层需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."demand_order_line_no" IS '顶层需求行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."production_order_no" IS '上层需求工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."production_order_line_no" IS '上层需求工单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."warehouse_no" IS '到货入库仓库号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."supplier_no" IS '供应商';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."data_source_type" IS '数据来源类型   ENGINE/MANUAL';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."erp_pr_no" IS 'erp pr 单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."erp_pr_header_id" IS 'erp pr header id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."erp_pr_line_id" IS 'erp pr line id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."erp_pr_status" IS 'erp pr 状态';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."risk_level" IS '欠料风险等级';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."production_material_request_date" IS '物料齐套需求时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_bak_20250521"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON TABLE "themetis_scp"."scp_planned_purchase_order_bak_20250521" IS '采购计划单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for scp_planned_purchase_order_null
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_purchase_order_null";
CREATE TABLE "themetis_scp"."scp_planned_purchase_order_null" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_purchase_order_id_seq2'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planned_purchase_order_no" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planned_quantity" numeric NOT NULL,
  "mrp_request_date" timestamp(6) NOT NULL,
  "ctp_request_date" timestamp(6),
  "mrp_arrival_date" timestamp(6),
  "ctp_arrival_date" timestamp(6),
  "mrp_release_date" timestamp(6),
  "ctp_release_date" timestamp(6),
  "mrp_consolidation_bucket_start_date" timestamp(6),
  "mrp_consolidation_bucket_end_date" timestamp(6),
  "ctp_consolidation_bucket_start_date" timestamp(6),
  "ctp_consolidation_bucket_end_date" timestamp(6),
  "product_material" varchar COLLATE "pg_catalog"."default",
  "demand_order_no" text COLLATE "pg_catalog"."default",
  "demand_order_line_no" text COLLATE "pg_catalog"."default",
  "production_order_no" text COLLATE "pg_catalog"."default",
  "production_order_line_no" text COLLATE "pg_catalog"."default",
  "warehouse_no" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "data_source_type" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar COLLATE "pg_catalog"."default",
  "erp_pr_no" varchar COLLATE "pg_catalog"."default",
  "erp_pr_header_id" varchar COLLATE "pg_catalog"."default",
  "erp_pr_line_id" varchar COLLATE "pg_catalog"."default",
  "erp_pr_status" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar COLLATE "pg_catalog"."default",
  "meta_attr02" varchar COLLATE "pg_catalog"."default",
  "meta_attr03" varchar COLLATE "pg_catalog"."default",
  "meta_attr04" varchar COLLATE "pg_catalog"."default",
  "meta_attr05" varchar COLLATE "pg_catalog"."default",
  "meta_attr06" varchar COLLATE "pg_catalog"."default",
  "meta_attr07" varchar COLLATE "pg_catalog"."default",
  "meta_attr08" varchar COLLATE "pg_catalog"."default",
  "meta_attr09" varchar COLLATE "pg_catalog"."default",
  "meta_attr10" varchar COLLATE "pg_catalog"."default",
  "meta_attr11" varchar COLLATE "pg_catalog"."default",
  "meta_attr12" varchar COLLATE "pg_catalog"."default",
  "meta_attr13" varchar COLLATE "pg_catalog"."default",
  "meta_attr14" varchar COLLATE "pg_catalog"."default",
  "meta_attr15" varchar COLLATE "pg_catalog"."default",
  "meta_attr16" varchar COLLATE "pg_catalog"."default",
  "meta_attr17" varchar COLLATE "pg_catalog"."default",
  "meta_attr18" varchar COLLATE "pg_catalog"."default",
  "meta_attr19" varchar COLLATE "pg_catalog"."default",
  "meta_attr20" varchar COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric,
  "meta_attr27" numeric,
  "meta_attr28" numeric,
  "meta_attr29" numeric,
  "meta_attr30" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "production_material_request_date" timestamp(6),
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "material_desc" varchar(1000) COLLATE "pg_catalog"."default",
  "supply_unit_name" varchar(100) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0
)
;

-- ----------------------------
-- Table structure for scp_planned_purchase_order_sr
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_purchase_order_sr";
CREATE TABLE "themetis_scp"."scp_planned_purchase_order_sr" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_purchase_order_sr_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "planned_purchase_order_no" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planned_quantity" numeric,
  "supplier_code" varchar COLLATE "pg_catalog"."default",
  "allocated_quantity" numeric,
  "allocation_ratio" numeric,
  "excessive_quantity" numeric,
  "released_quantity" numeric,
  "effective_start_date" timestamp(6),
  "effective_end_date" timestamp(6),
  "min_lot_size" numeric,
  "max_lot_size" numeric,
  "lot_size_multiple" numeric,
  "consolidation_days" int4,
  "lateness_tolerance" int4,
  "unit_purchasing_cost" numeric,
  "fix_purchasing_cost" numeric,
  "supplier_calendar_no" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "purchase_request_no" varchar COLLATE "pg_catalog"."default",
  "purchase_request_line_no" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "erp_pr_header_id" varchar COLLATE "pg_catalog"."default",
  "erp_pr_status" varchar COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "supplier_name" varchar(200) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "manufacturer_part_no" varchar(100) COLLATE "pg_catalog"."default",
  "inventory_management_material" varchar(100) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "error_message" varchar(1000) COLLATE "pg_catalog"."default",
  "purchase_requisition_type" varchar(50) COLLATE "pg_catalog"."default" DEFAULT '1'::character varying
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."planned_purchase_order_no" IS '计划订单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."planned_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."supplier_code" IS '供应商';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."allocated_quantity" IS '分配数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."allocation_ratio" IS '分配比例';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."excessive_quantity" IS '超买数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."released_quantity" IS '已分配数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."effective_start_date" IS '生效时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."effective_end_date" IS '失效时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."min_lot_size" IS '最小批量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."max_lot_size" IS '最大批量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."lot_size_multiple" IS '批量倍数';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."lateness_tolerance" IS '容忍度';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."unit_purchasing_cost" IS '单位采购成本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."fix_purchasing_cost" IS '固定采购成本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."purchase_request_no" IS 'PR单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."purchase_request_line_no" IS 'PR行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."erp_pr_header_id" IS 'erp pr header id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."erp_pr_status" IS 'erp pr 状态';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."interface_status" IS '接口状态，0失败 1成功';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."supplier_name" IS '供应商名称';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."manufacturer_part_no" IS '供应商零件编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."inventory_management_material" IS '库存管理物料（母件编码）';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."error_message" IS '接口返回信息';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order_sr"."purchase_requisition_type" IS 'pr类型，枚举值：1：生产需求，2：售后需求，3：试产需求，4：研发需求，默认1';
COMMENT ON TABLE "themetis_scp"."scp_planned_purchase_order_sr" IS '采购计划订单拆分';

-- ----------------------------
-- Table structure for scp_planning_simulation_scenario
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planning_simulation_scenario";
CREATE TABLE "themetis_scp"."scp_planning_simulation_scenario" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planning_simulation_scenario_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "sim_workbench_code" varchar(255) COLLATE "pg_catalog"."default",
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_name" varchar(100) COLLATE "pg_catalog"."default",
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_workflow_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_instance_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_run_batch_id" int8 NOT NULL,
  "remarks" varchar(255) COLLATE "pg_catalog"."default",
  "sim_workflow_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_instance_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_run_batch_id" int8,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "last_run_time" timestamp(6),
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "sim_runtime_workflow_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "sim_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_source_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_bl" bool NOT NULL,
  "sim_data_source" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_workbench_code" varchar(100) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."sim_workbench_code" IS '模拟的工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."bl_period_code" IS '基线期次号';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."bl_run_batch_id" IS '基线运行批次id';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."last_run_time" IS '最后运行时间';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."sim_runtime_workflow_id" IS '模拟工作流实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."sim_type_code" IS '模拟类型';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."demand_source_code" IS '需求来源';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."source_period_code" IS '来源期次号';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."compare_bl" IS '是否对比基线';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."sim_data_source" IS '模拟数据来源 real_time 取实时单据数据 base_line取基线数据';
COMMENT ON COLUMN "themetis_scp"."scp_planning_simulation_scenario"."bl_workbench_code" IS '基线工作台代码';

-- ----------------------------
-- Table structure for scp_production_order_exception
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_production_order_exception";
CREATE TABLE "themetis_scp"."scp_production_order_exception" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_production_order_exception_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material_production_version_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "original_order_id" int8,
  "material" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "original_planned_start_date" timestamp(6) NOT NULL,
  "suggested_planned_start_date" timestamp(6),
  "original_total_product_quantity" numeric(20,6) NOT NULL,
  "suggested_total_product_quantity" numeric(20,6) DEFAULT NULL::numeric,
  "exception_action_type" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "remarks" varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "data_source_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr27" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr28" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr29" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr30" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr37" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr38" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr39" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr40" numeric(20,6) DEFAULT NULL::numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::bigint,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "contract_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "project_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "advance_push_times" int8 DEFAULT 0,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."supply_unit_code" IS '计划工厂';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."production_order_no" IS '工单号';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."material_production_version_no" IS '物料生产方案';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."original_order_id" IS '源系统工单ID';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."material" IS '工单产成品';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."material_revision" IS '工单产成品版本';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."original_planned_start_date" IS '原开工日期';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."suggested_planned_start_date" IS '建议开工日期';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."original_total_product_quantity" IS '原生产数量';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."suggested_total_product_quantity" IS '建议生产数量';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."exception_action_type" IS '例外类型：ADVANCE提前，POSTPONE推后，CANCEL取消';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."data_source_type" IS '数据来源：ENGINE/MANUAL';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."advance_push_times" IS '延迟或提前天数';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_production_order_exception"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_production_order_exception" IS '在制工单例外信息';

-- ----------------------------
-- Table structure for scp_purchase_forecast_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_purchase_forecast_bucket_data";
CREATE TABLE "themetis_scp"."scp_purchase_forecast_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_purchase_forecast_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "vendor_code" varchar(50) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "manufacturer_part_no" varchar(100) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."vendor_code" IS '供应商编码（拆分用）';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."manufacturer_part_no" IS '制造商零件编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_purchase_forecast_bucket_data" IS '主计划计划数据';

-- ----------------------------
-- Table structure for scp_purchase_forecast_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_purchase_forecast_item";
CREATE TABLE "themetis_scp"."scp_purchase_forecast_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_purchase_forecast_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "buyer_id" int8,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "purchasing_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "vendor_code" varchar(50) COLLATE "pg_catalog"."default",
  "allocation_ratio" numeric(8,6),
  "vendor_name" varchar(200) COLLATE "pg_catalog"."default",
  "remark" varchar(500) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "manufacturer_part_no" varchar(100) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "error_message" varchar(1000) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."buyer_id" IS '采购员ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."purchasing_delivery_method" IS '采购物料交付方式：NORMAL/JIT/VMI';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."risk_level" IS '欠料风险等级';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."vendor_code" IS '供应商编码（拆分用）';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."allocation_ratio" IS '供应商份额';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."vendor_name" IS '供应商名称';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."remark" IS '备注';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."manufacturer_part_no" IS '制造商零件编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."interface_status" IS '接口状态，0失败 1成功';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_forecast_item"."error_message" IS '接口返回信息';
COMMENT ON TABLE "themetis_scp"."scp_purchase_forecast_item" IS '采购预测计划对象数据';

-- ----------------------------
-- Table structure for scp_purchase_order_exception
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_purchase_order_exception";
CREATE TABLE "themetis_scp"."scp_purchase_order_exception" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_purchase_order_exception_id_seq1'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "purchase_order_no" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "purchase_order_line_no" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "original_po_line_id" int8,
  "shipment_no" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default",
  "original_supply_date" timestamp(6) NOT NULL,
  "suggested_supply_date" timestamp(6),
  "original_supply_quantity" numeric NOT NULL,
  "suggested_supply_quantity" numeric,
  "exception_action_type" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "data_source_type" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "advance_push_times" int8 DEFAULT 0,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "recommended_cancellation_quantity" numeric,
  "redundant_outlook_period" timestamp(6),
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "inventory_excess_horizon" timestamp(6),
  "error_message" varchar(1000) COLLATE "pg_catalog"."default",
  "vendor_code" varchar(50) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."purchase_order_no" IS '采购单号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."purchase_order_line_no" IS '采购单行号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."original_po_line_id" IS '源系统PO行ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."shipment_no" IS '采购单发运号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."material" IS '物料编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."original_supply_date" IS '原供应日期';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."suggested_supply_date" IS '建议供应日期';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."original_supply_quantity" IS '原供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."suggested_supply_quantity" IS '建议供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."exception_action_type" IS '例外类型：ADVANCE提前，POSTPONE推后，CANCEL取消';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."data_source_type" IS '数据来源：ENGINE/MANUAL';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."risk_level" IS '欠料风险等级';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."advance_push_times" IS '延迟或提前天数';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."recommended_cancellation_quantity" IS '建议取消数量=原供应数量-建议供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."redundant_outlook_period" IS '冗余展望期,=当前期次开始日期+该PO的供应商的L/T+冗余范围';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."interface_status" IS '接口状态，0失败 1成功';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."inventory_excess_horizon" IS '冗余展望期,=当前期次开始日期+该PO的供应商的L/T+冗余范围';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."error_message" IS '接口返回信息';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_order_exception"."vendor_code" IS '供应商编码（拆分用）';
COMMENT ON TABLE "themetis_scp"."scp_purchase_order_exception" IS '采购例外信息';

-- ----------------------------
-- Table structure for scp_purchase_planning_analysis_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_purchase_planning_analysis_bucket_data";
CREATE TABLE "themetis_scp"."scp_purchase_planning_analysis_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_purchase_planning_analysis_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_purchase_planning_analysis_bucket_data" IS '主计划计划数据';

-- ----------------------------
-- Table structure for scp_purchase_planning_analysis_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_purchase_planning_analysis_item";
CREATE TABLE "themetis_scp"."scp_purchase_planning_analysis_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_purchase_planning_analysis_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "buyer_id" int8,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "purchasing_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."buyer_id" IS '采购员ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."purchasing_delivery_method" IS '采购物料交付方式：NORMAL/JIT/VMI';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."risk_level" IS '欠料风险等级';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_analysis_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_purchase_planning_analysis_item" IS '采购预测计划对象数据';

-- ----------------------------
-- Table structure for scp_purchase_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_purchase_planning_item";
CREATE TABLE "themetis_scp"."scp_purchase_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_purchase_planning_item_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar COLLATE "pg_catalog"."default",
  "product_category_code" varchar COLLATE "pg_catalog"."default",
  "planner_code" varchar COLLATE "pg_catalog"."default",
  "material" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "buyer_id" int4 NOT NULL,
  "purchase_category_id" varchar COLLATE "pg_catalog"."default",
  "lead_time" numeric,
  "consolidation_days" int4,
  "min_lot_size" numeric,
  "max_lot_size" numeric,
  "lot_size_multiple" numeric,
  "unit_purchasing_cost" numeric,
  "fix_purchasing_cost" numeric,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."buyer_id" IS '采购员用户ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."purchase_category_id" IS '采购物品分类ID';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."lead_time" IS '货期';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."min_lot_size" IS '最小批量';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."max_lot_size" IS '最大批量';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."lot_size_multiple" IS '批量倍数';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."unit_purchasing_cost" IS '单位采购成本';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."fix_purchasing_cost" IS '固定采购成本';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_purchase_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_purchase_planning_item" IS '采购计划主数据，默认主数据类型';

-- ----------------------------
-- Table structure for scp_raw_pegging_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_raw_pegging_bucket_data";
CREATE TABLE "themetis_scp"."scp_raw_pegging_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_raw_pegging_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default",
  "demand_order_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_material" varchar(200) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."demand_order_no" IS '需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."demand_order_line_no" IS '需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."demand_order_material" IS '顶层成品';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."product_material" IS '父项物料';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_raw_pegging_bucket_data" IS '原材料匹配数据';

-- ----------------------------
-- Table structure for scp_raw_pegging_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_raw_pegging_planning_item";
CREATE TABLE "themetis_scp"."scp_raw_pegging_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_raw_pegging_planning_item_id_seq'::regclass),
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "purchasing_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_bom_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default",
  "demand_order_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_material" varchar(200) COLLATE "pg_catalog"."default",
  "accum_bom_qty_per" numeric(20,6),
  "accum_material_rate" numeric(20,6),
  "buyer_id" int8,
  "accumulated_leadtime" numeric(20,6),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."material_group_code" IS '物料组';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."purchasing_delivery_method" IS '采购物料交付方式：NORMAL/JIT/VMI';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."product_bom_path" IS '产品bom路径';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."demand_order_no" IS '需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."demand_order_line_no" IS '需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."demand_order_material" IS '顶层成品';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."demand_order_material_revision" IS '顶层物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."product_material" IS '父项物料';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."accum_bom_qty_per" IS '累计需求用量';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."accum_material_rate" IS '累计良率';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."accumulated_leadtime" IS '累计加工周期/天';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_raw_pegging_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_raw_pegging_planning_item" IS '原材料预缺料计划对象数据';

-- ----------------------------
-- Table structure for scp_resource_anlysis_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_resource_anlysis_bucket_data";
CREATE TABLE "themetis_scp"."scp_resource_anlysis_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_resource_anlysis_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "constraint_type" varchar(20) COLLATE "pg_catalog"."default",
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."resource_no" IS '资源号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."resource_group" IS '资源分组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."constraint_type" IS '约束类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."product_hierarchy_code" IS '产品树';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."product_category_code" IS '产品目录代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_resource_anlysis_bucket_data" IS '资源数据';

-- ----------------------------
-- Table structure for scp_resource_anlysis_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_resource_anlysis_planning_item";
CREATE TABLE "themetis_scp"."scp_resource_anlysis_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_resource_anlysis_planning_item_id_seq'::regclass),
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "resource_type" varchar(100) COLLATE "pg_catalog"."default",
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "resource_setup_type" varchar(30) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "out_source_flag" bool,
  "out_source_supplier" varchar(100) COLLATE "pg_catalog"."default",
  "constraint_type" varchar(20) COLLATE "pg_catalog"."default",
  "resource_max_capacity" numeric(20,6),
  "resource_max_requirement" numeric(20,6),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "status" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."resource_no" IS '资源号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."resource_type" IS '资源类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."resource_group" IS '资源分组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."resource_setup_type" IS '资源准备类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."product_hierarchy_path" IS '产品路径';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."attribute_code" IS '属性';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."out_source_flag" IS '是否外协';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."out_source_supplier" IS '外协供应商';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."constraint_type" IS '约束类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."resource_max_capacity" IS '资源最大产能';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."resource_max_requirement" IS '资源最大需求';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_anlysis_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_resource_anlysis_planning_item" IS '资源产能分析对象';

-- ----------------------------
-- Table structure for scp_resource_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_resource_bucket_data";
CREATE TABLE "themetis_scp"."scp_resource_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_resource_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "constraint_type" varchar(20) COLLATE "pg_catalog"."default",
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."resource_no" IS '资源号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."resource_group" IS '资源分组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."constraint_type" IS '约束类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."product_hierarchy_code" IS '产品树';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."product_category_code" IS '产品目录代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_resource_bucket_data" IS '资源数据';

-- ----------------------------
-- Table structure for scp_resource_planning_attribute
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_resource_planning_attribute";
CREATE TABLE "themetis_scp"."scp_resource_planning_attribute" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_material_planning_attribute_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_type" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "critical_flag" bool,
  "resource_desc" varchar(255) COLLATE "pg_catalog"."default",
  "planning_figure" varchar(100) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(100) COLLATE "pg_catalog"."default",
  "constraint_calc_flag" bool,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."supply_unit_code" IS '供应计划单元;计划工厂';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."resource_no" IS '资源号，业务主键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."resource_type" IS '资源类型，Individual/Pooled';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."critical_flag" IS '关键资源标识，用于主计划引擎输入,评审产能标识';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."resource_desc" IS '资源描述';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."planning_figure" IS '计划维度';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_attribute"."constraint_calc_flag" IS '是否参与约束计算';

-- ----------------------------
-- Table structure for scp_resource_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_resource_planning_item";
CREATE TABLE "themetis_scp"."scp_resource_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_resource_planning_item_id_seq'::regclass),
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "resource_type" varchar(100) COLLATE "pg_catalog"."default",
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "resource_setup_type" varchar(30) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "out_source_flag" bool,
  "out_source_supplier" varchar(100) COLLATE "pg_catalog"."default",
  "constraint_type" varchar(20) COLLATE "pg_catalog"."default",
  "resource_max_capacity" numeric(20,6),
  "resource_max_requirement" numeric(20,6),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."resource_no" IS '资源号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."resource_type" IS '资源类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."resource_group" IS '资源分组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."resource_setup_type" IS '资源准备类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."product_hierarchy_path" IS '产品路径';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."attribute_code" IS '属性';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."out_source_flag" IS '是否外协';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."out_source_supplier" IS '外协供应商';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."constraint_type" IS '约束类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."resource_max_capacity" IS '资源最大产能';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."resource_max_requirement" IS '资源最大需求';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_resource_planning_item" IS '资源产能对象';

-- ----------------------------
-- Table structure for scp_resource_shortage_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_resource_shortage_bucket_data";
CREATE TABLE "themetis_scp"."scp_resource_shortage_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_resource_shortage_bucket_data_id_seq'::regclass),
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "resource_group" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "bucket_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "bk_qty_105" numeric,
  "bk_qty_106" numeric,
  "bk_qty_107" numeric,
  "bk_qty_108" numeric,
  "bk_qty_109" numeric,
  "bk_qty_110" numeric,
  "bk_qty_111" numeric,
  "bk_qty_112" numeric,
  "bk_qty_113" numeric,
  "bk_qty_114" numeric,
  "bk_qty_115" numeric,
  "bk_qty_116" numeric,
  "bk_qty_117" numeric,
  "bk_qty_118" numeric,
  "bk_qty_119" numeric,
  "bk_qty_120" numeric,
  "bk_qty_121" numeric,
  "bk_qty_122" numeric,
  "bk_qty_123" numeric,
  "bk_qty_124" numeric,
  "bk_qty_125" numeric,
  "bk_qty_126" numeric,
  "bk_qty_127" numeric,
  "bk_qty_128" numeric,
  "bk_qty_129" numeric,
  "bk_qty_130" numeric,
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "resource_type" varchar(100) COLLATE "pg_catalog"."default",
  "operation_code" varchar COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default",
  "bk_qty_131" numeric(20,6),
  "bk_qty_132" numeric(20,6),
  "bk_qty_133" numeric(20,6),
  "bk_qty_134" numeric(20,6),
  "bk_qty_135" numeric(20,6),
  "bk_qty_136" numeric(20,6),
  "bk_qty_137" numeric(20,6),
  "bk_qty_138" numeric(20,6),
  "bk_qty_139" numeric(20,6),
  "bk_qty_140" numeric(20,6),
  "bk_qty_141" numeric(20,6),
  "bk_qty_142" numeric(20,6),
  "bk_qty_143" numeric(20,6),
  "bk_qty_144" numeric(20,6),
  "bk_qty_145" numeric(20,6),
  "bk_qty_146" numeric(20,6),
  "bk_qty_147" numeric(20,6),
  "bk_qty_148" numeric(20,6),
  "bk_qty_149" numeric(20,6),
  "bk_qty_150" numeric(20,6),
  "bk_qty_151" numeric(20,6),
  "bk_qty_152" numeric(20,6),
  "bk_qty_153" numeric(20,6),
  "bk_qty_154" numeric(20,6),
  "bk_qty_155" numeric(20,6),
  "bk_qty_156" numeric(20,6),
  "bk_qty_157" numeric(20,6),
  "bk_qty_158" numeric(20,6),
  "bk_qty_159" numeric(20,6),
  "bk_qty_160" numeric(20,6),
  "bk_qty_161" numeric(20,6),
  "bk_qty_162" numeric(20,6),
  "bk_qty_163" numeric(20,6),
  "bk_qty_164" numeric(20,6),
  "bk_qty_165" numeric(20,6),
  "bk_qty_166" numeric(20,6),
  "bk_qty_167" numeric(20,6),
  "bk_qty_168" numeric(20,6),
  "bk_qty_169" numeric(20,6),
  "bk_qty_170" numeric(20,6),
  "bk_qty_171" numeric(20,6),
  "bk_qty_172" numeric(20,6),
  "bk_qty_173" numeric(20,6),
  "bk_qty_174" numeric(20,6),
  "bk_qty_175" numeric(20,6),
  "bk_qty_176" numeric(20,6),
  "bk_qty_177" numeric(20,6),
  "bk_qty_178" numeric(20,6),
  "bk_qty_179" numeric(20,6),
  "bk_qty_180" numeric(20,6),
  "bk_qty_181" numeric(20,6),
  "bk_qty_182" numeric(20,6),
  "bk_qty_183" numeric(20,6),
  "bk_qty_184" numeric(20,6),
  "bk_qty_185" numeric(20,6),
  "bk_qty_186" numeric(20,6),
  "bk_qty_187" numeric(20,6),
  "bk_qty_188" numeric(20,6),
  "bk_qty_189" numeric(20,6),
  "bk_qty_190" numeric(20,6),
  "bk_qty_191" numeric(20,6),
  "bk_qty_192" numeric(20,6),
  "bk_qty_193" numeric(20,6),
  "bk_qty_194" numeric(20,6),
  "bk_qty_195" numeric(20,6),
  "bk_qty_196" numeric(20,6),
  "bk_qty_197" numeric(20,6),
  "bk_qty_198" numeric(20,6),
  "bk_qty_199" numeric(20,6),
  "bk_qty_200" numeric(20,6),
  "bk_qty_201" numeric(20,6),
  "bk_qty_202" numeric(20,6),
  "bk_qty_203" numeric(20,6),
  "bk_qty_204" numeric(20,6),
  "bk_qty_205" numeric(20,6),
  "bk_qty_206" numeric(20,6),
  "bk_qty_207" numeric(20,6),
  "bk_qty_208" numeric(20,6),
  "bk_qty_209" numeric(20,6),
  "bk_qty_210" numeric(20,6),
  "bk_qty_211" numeric(20,6),
  "bk_qty_212" numeric(20,6),
  "bk_qty_213" numeric(20,6),
  "bk_qty_214" numeric(20,6),
  "bk_qty_215" numeric(20,6),
  "bk_qty_216" numeric(20,6),
  "bk_qty_217" numeric(20,6),
  "bk_qty_218" numeric(20,6),
  "bk_qty_219" numeric(20,6),
  "classification_dimensions" varchar(100) COLLATE "pg_catalog"."default",
  "capacity_package_name" varchar(200) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."id" IS '自增id';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."resource_no" IS '资源号，业务主键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."supply_unit_code" IS '供应计划单元，外键：md_plan_unit.plan_unit';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."material" IS '物料;';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bucket_type_code" IS '时段类型编码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."remarks" IS '备注';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_105" IS 'bucket数量105';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_106" IS 'bucket数量106';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_107" IS 'bucket数量107';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_108" IS 'bucket数量108';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_109" IS 'bucket数量109';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_110" IS 'bucket数量110';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_111" IS 'bucket数量111';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_112" IS 'bucket数量112';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_113" IS 'bucket数量113';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_114" IS 'bucket数量114';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_115" IS 'bucket数量115';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_116" IS 'bucket数量116';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_117" IS 'bucket数量117';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_118" IS 'bucket数量118';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_119" IS 'bucket数量119';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_120" IS 'bucket数量120';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_121" IS 'bucket数量121';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_122" IS 'bucket数量122';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_123" IS 'bucket数量123';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_124" IS 'bucket数量124';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_125" IS 'bucket数量125';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_126" IS 'bucket数量126';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_127" IS 'bucket数量127';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_128" IS 'bucket数量128';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_129" IS 'bucket数量129';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_130" IS 'bucket数量130';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."resource_type" IS '资源类型';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."operation_code" IS '工序编码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_131" IS 'bucket数量131';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_132" IS 'bucket数量132';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_133" IS 'bucket数量133';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_134" IS 'bucket数量134';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_135" IS 'bucket数量135';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_136" IS 'bucket数量136';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_137" IS 'bucket数量137';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_138" IS 'bucket数量138';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_139" IS 'bucket数量139';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_140" IS 'bucket数量140';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_141" IS 'bucket数量141';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_142" IS 'bucket数量142';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_143" IS 'bucket数量143';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_144" IS 'bucket数量144';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_145" IS 'bucket数量145';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_146" IS 'bucket数量146';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_147" IS 'bucket数量147';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_148" IS 'bucket数量148';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_149" IS 'bucket数量149';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_150" IS 'bucket数量150';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_151" IS 'bucket数量151';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_152" IS 'bucket数量152';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_153" IS 'bucket数量153';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_154" IS 'bucket数量154';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_155" IS 'bucket数量155';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_156" IS 'bucket数量156';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_157" IS 'bucket数量157';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_158" IS 'bucket数量158';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_159" IS 'bucket数量159';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_160" IS 'bucket数量160';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_161" IS 'bucket数量161';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_162" IS 'bucket数量162';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_163" IS 'bucket数量163';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_164" IS 'bucket数量164';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_165" IS 'bucket数量165';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_166" IS 'bucket数量166';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_167" IS 'bucket数量167';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_168" IS 'bucket数量168';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_169" IS 'bucket数量169';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_170" IS 'bucket数量170';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_171" IS 'bucket数量171';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_172" IS 'bucket数量172';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_173" IS 'bucket数量173';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_174" IS 'bucket数量174';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_175" IS 'bucket数量175';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_176" IS 'bucket数量176';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_177" IS 'bucket数量177';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_178" IS 'bucket数量178';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_179" IS 'bucket数量179';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_180" IS 'bucket数量180';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_181" IS 'bucket数量181';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_182" IS 'bucket数量182';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_183" IS 'bucket数量183';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_184" IS 'bucket数量184';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_185" IS 'bucket数量185';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_186" IS 'bucket数量186';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_187" IS 'bucket数量187';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_188" IS 'bucket数量188';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_189" IS 'bucket数量189';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_190" IS 'bucket数量190';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_191" IS 'bucket数量191';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_192" IS 'bucket数量192';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_193" IS 'bucket数量193';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_194" IS 'bucket数量194';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_195" IS 'bucket数量195';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_196" IS 'bucket数量196';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_197" IS 'bucket数量197';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_198" IS 'bucket数量198';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_199" IS 'bucket数量199';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_200" IS 'bucket数量200';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_201" IS 'bucket数量201';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_202" IS 'bucket数量202';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_203" IS 'bucket数量203';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_204" IS 'bucket数量204';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_205" IS 'bucket数量205';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_206" IS 'bucket数量206';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_207" IS 'bucket数量207';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_208" IS 'bucket数量208';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_209" IS 'bucket数量209';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_210" IS 'bucket数量210';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_211" IS 'bucket数量211';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_212" IS 'bucket数量212';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_213" IS 'bucket数量213';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_214" IS 'bucket数量214';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_215" IS 'bucket数量215';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_216" IS 'bucket数量216';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_217" IS 'bucket数量217';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_218" IS 'bucket数量218';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."bk_qty_219" IS 'bucket数量219';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."classification_dimensions" IS '分类维度';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_bucket_data"."capacity_package_name" IS '产能包名称';

-- ----------------------------
-- Table structure for scp_resource_shortage_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_resource_shortage_planning_item";
CREATE TABLE "themetis_scp"."scp_resource_shortage_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_resource_shortage_planning_item_id_seq'::regclass),
  "resource_no" varchar(100) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_group" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "classification_dimensions" varchar(100) COLLATE "pg_catalog"."default",
  "capacity_package_name" varchar(200) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."id" IS '自增id';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."resource_no" IS '资源号，业务主键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."supply_unit_code" IS '供应计划单元，外键：md_plan_unit.plan_unit';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."remarks" IS '备注';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr01" IS '预留字段 01';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr02" IS '预留字段 02';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr03" IS '预留字段 03';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr04" IS '预留字段 04';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr05" IS '预留字段 05';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr06" IS '缺口数据（gap）';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr07" IS '预留字段 07';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr08" IS '预留字段 08';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr09" IS '预留字段 09';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr10" IS '预留字段 10';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr11" IS '预留字段 11';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr12" IS '预留字段 12';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr13" IS '预留字段 13';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr14" IS '预留字段 14';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr15" IS '预留字段 15';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr16" IS '预留字段 16';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr17" IS '预留字段 17';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr18" IS '预留字段 18';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr19" IS '预留字段 19';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr20" IS '预留字段 20';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr21" IS '预留时间戳字段 21';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr22" IS '预留时间戳字段 22';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr23" IS '预留时间戳字段 23';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr24" IS '预留时间戳字段 24';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr25" IS '预留时间戳字段 25';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr26" IS '预留数值字段 26，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr27" IS '预留数值字段 27，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr28" IS '预留数值字段 28，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr29" IS '预留数值字段 29，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."meta_attr30" IS '预留数值字段 30，精度 20，小数位 6';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."classification_dimensions" IS '分类维度';
COMMENT ON COLUMN "themetis_scp"."scp_resource_shortage_planning_item"."capacity_package_name" IS '产能包名称';

-- ----------------------------
-- Table structure for scp_safety_stock_simulation_log
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_safety_stock_simulation_log";
CREATE TABLE "themetis_scp"."scp_safety_stock_simulation_log" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_safety_stock_simulation_log_id_seq'::regclass),
  "sim_scenario_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_scenario_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "period_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "current_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "schedule_start_date" date,
  "sim_workflow_id" int8,
  "sim_workflow_name" varchar(64) COLLATE "pg_catalog"."default",
  "sim_instance_id" varchar(100) COLLATE "pg_catalog"."default",
  "sim_run_batch_id" varchar(100) COLLATE "pg_catalog"."default",
  "delete_flag" bool NOT NULL DEFAULT false,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."sim_scenario_code" IS '模拟场景代码';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."sim_scenario_name" IS '模拟场景名称';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."current_period_code" IS '当前期次';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."schedule_start_date" IS '计划开始日期';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."sim_workflow_id" IS '模拟工作流ID';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."sim_workflow_name" IS '模拟工作流名称';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."sim_instance_id" IS '模拟引擎实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_safety_stock_simulation_log"."sim_run_batch_id" IS '模拟运行批次ID';

-- ----------------------------
-- Table structure for scp_shortage_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_shortage_bucket_data";
CREATE TABLE "themetis_scp"."scp_shortage_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_shortage_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."material_group_code" IS '物料组编码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_shortage_bucket_data" IS '预缺料数据';

-- ----------------------------
-- Table structure for scp_shortage_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_shortage_planning_item";
CREATE TABLE "themetis_scp"."scp_shortage_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_shortage_planning_item_id_seq'::regclass),
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "risk_horizon_type" varchar(100) COLLATE "pg_catalog"."default",
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "shortage_date" date,
  "current_inventory_quantity" numeric(20,6),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "purchasing_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "buyer_id" int8,
  "supplier_code" varchar(100) COLLATE "pg_catalog"."default",
  "min_lot_size" numeric(20,6),
  "max_lot_size" numeric(20,6),
  "lot_size_multiple" numeric(20,6),
  "consolidation_days" int4,
  "lead_time" numeric(20,6),
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "constraint_flag" bool,
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."risk_horizon_type" IS '欠料风险类别';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."risk_level" IS '欠料风险等级';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."shortage_date" IS '开始欠料日期';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."current_inventory_quantity" IS '当前库存';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."purchasing_delivery_method" IS '采购物料交付方式：NORMAL/JIT/VMI';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."buyer_id" IS '采购员用户ID';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."supplier_code" IS '供应商编码';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."min_lot_size" IS '最小批量';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."max_lot_size" IS '最大批量';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."lot_size_multiple" IS '批量倍数';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."lead_time" IS '采购周期';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."constraint_flag" IS '约束标识';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_shortage_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_shortage_planning_item" IS '原材料预缺料计划对象数据';

-- ----------------------------
-- Table structure for scp_sim_demand_comparation
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_demand_comparation";
CREATE TABLE "themetis_scp"."scp_sim_demand_comparation" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_demand_comparation_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_scenario_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "simulation_type" int2 NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_material_revision" varchar(50) COLLATE "pg_catalog"."default",
  "demand_order_id" int8,
  "demand_order_line_id" int8,
  "demand_order_plan_line_id" int8,
  "mrp_request_date" timestamp(6),
  "sim_request_date" timestamp(6),
  "latest_supply_date" timestamp(6),
  "sim_supply_date" timestamp(6),
  "add_lateness_days" int4,
  "mrp_require_quantity" numeric(20,6),
  "sim_require_quantity" numeric(20,6),
  "ontime_supply_quantity" numeric(20,6),
  "sim_ontime_supply_quantity" numeric(20,6),
  "demand_revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "demand_attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "sim_demand_priority" int8,
  "demand_type" varchar(30) COLLATE "pg_catalog"."default",
  "mts_order_flag" bool DEFAULT false,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."sim_scenario_code" IS '模拟场景代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."sim_period_code" IS '模拟期次号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."simulation_type" IS '1：插单，2：追加，3：变更，4：取消，5. 未变更';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_order_no" IS '需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_order_line_no" IS '需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_order_material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_order_material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_order_id" IS '需求ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_order_line_id" IS '需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_order_plan_line_id" IS '拆分齐套能力后的需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."mrp_request_date" IS '原需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."sim_request_date" IS '现需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."latest_supply_date" IS '原供应最晚时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."sim_supply_date" IS '模拟供应日期';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."add_lateness_days" IS '影响延迟天数';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."mrp_require_quantity" IS '原需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."sim_require_quantity" IS '现需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."ontime_supply_quantity" IS '按原需求时间供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."sim_ontime_supply_quantity" IS '按现需求时间供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_attribute_code" IS '需求属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_priority" IS '原需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."sim_demand_priority" IS '现需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."demand_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_comparation"."mts_order_flag" IS '是否MTS标识';
COMMENT ON TABLE "themetis_scp"."scp_sim_demand_comparation" IS '模拟需求结果对比';

-- ----------------------------
-- Table structure for scp_sim_demand_order
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_demand_order";
CREATE TABLE "themetis_scp"."scp_sim_demand_order" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_demand_order_id_seq'::regclass),
  "sim_scenario_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "simulation_type" int2 NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_material_revision" varchar(50) COLLATE "pg_catalog"."default",
  "demand_order_id" int8,
  "demand_order_line_id" int8,
  "demand_order_plan_line_id" int8,
  "mrp_request_date" timestamp(6),
  "sim_request_date" timestamp(6),
  "latest_supply_date" timestamp(6),
  "mrp_require_quantity" numeric(20,6),
  "sim_require_quantity" numeric(20,6),
  "ontime_supply_quantity" numeric(20,6),
  "demand_revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "demand_attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "sim_demand_priority" int8,
  "demand_type" varchar(30) COLLATE "pg_catalog"."default",
  "mts_order_flag" bool DEFAULT false,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."sim_scenario_code" IS '模拟场景代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."simulation_type" IS '1：插单，2：追加，3：变更，4：取消，5. 未变更';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_order_no" IS '需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_order_line_no" IS '需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_order_material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_order_material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_order_id" IS '需求ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_order_line_id" IS '需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_order_plan_line_id" IS '拆分齐套能力后的需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."mrp_request_date" IS '原需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."sim_request_date" IS '模拟需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."latest_supply_date" IS '供应最晚时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."mrp_require_quantity" IS '原需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."sim_require_quantity" IS '模拟需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."ontime_supply_quantity" IS '按需求时间供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_attribute_code" IS '需求属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_priority" IS '原需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."sim_demand_priority" IS '模拟需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."demand_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order"."mts_order_flag" IS '是否MTS标识';
COMMENT ON TABLE "themetis_scp"."scp_sim_demand_order" IS '模拟需求单';

-- ----------------------------
-- Table structure for scp_sim_demand_order_period
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_demand_order_period";
CREATE TABLE "themetis_scp"."scp_sim_demand_order_period" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_demand_order_period_id_seq'::regclass),
  "sim_scenario_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "simulation_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_order_material_revision" varchar(50) COLLATE "pg_catalog"."default",
  "demand_order_id" int8,
  "demand_order_line_id" int8,
  "demand_order_plan_line_id" int8,
  "mrp_request_date" timestamp(6),
  "sim_request_date" timestamp(6),
  "latest_supply_date" timestamp(6),
  "mrp_require_quantity" numeric(20,6),
  "sim_require_quantity" numeric(20,6),
  "ontime_supply_quantity" numeric(20,6),
  "demand_revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "demand_attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "sim_demand_priority" int8,
  "demand_type" varchar(30) COLLATE "pg_catalog"."default",
  "mts_order_flag" bool DEFAULT false,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."sim_scenario_code" IS '模拟场景代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."sim_period_code" IS '模拟期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."simulation_type" IS '1：插单，2：追加，3：变更，4：取消，5. 未变更';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_order_no" IS '需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_order_line_no" IS '需求单行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_order_material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_order_material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_order_id" IS '需求ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_order_line_id" IS '需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_order_plan_line_id" IS '拆分齐套能力后的需求行ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."mrp_request_date" IS '原需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."sim_request_date" IS '模拟需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."latest_supply_date" IS '供应最晚时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."mrp_require_quantity" IS '原需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."sim_require_quantity" IS '模拟需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."ontime_supply_quantity" IS '按需求时间供应数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_attribute_code" IS '需求属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_priority" IS '原需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."sim_demand_priority" IS '模拟需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."demand_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."scp_sim_demand_order_period"."mts_order_flag" IS '是否MTS标识';
COMMENT ON TABLE "themetis_scp"."scp_sim_demand_order_period" IS '历史期次模拟需求单';

-- ----------------------------
-- Table structure for scp_sim_planning_available_inventory
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_planning_available_inventory";
CREATE TABLE "themetis_scp"."scp_sim_planning_available_inventory" (
  "id" int4 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_planning_available_inventory_id_seq'::regclass),
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "available_inventory_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "material" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "available_quantity" numeric(20,6) DEFAULT NULL::numeric,
  "warehouse_no" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "stock_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "location_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_priority" int8,
  "supply_bucket_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "effective_start_date" timestamp(6),
  "effective_end_date" timestamp(6),
  "supply_date" timestamp(6),
  "supply_category_id" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "project_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "order_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_full_peg_flag" bool,
  "instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "etl_batch_id" int8,
  "log_date" timestamp(6),
  "tenant_id" int8 NOT NULL DEFAULT '-1'::bigint,
  "run_batch_id" int8,
  "load_date" timestamp(6),
  "contract_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "bl_run_batch_id" int8,
  "update_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr27" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr28" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr29" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr30" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr37" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr38" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr39" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr40" numeric(20,6) DEFAULT NULL::numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "p_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."available_inventory_no" IS '库存单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."available_quantity" IS '可用数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."warehouse_no" IS '仓库号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."stock_no" IS '子库';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."location_no" IS '货位';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."supply_priority" IS '供应优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."supply_bucket_no" IS '物料供应的计划时段单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."effective_start_date" IS '供应生效时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."effective_end_date" IS '供应失效时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."supply_date" IS '供应时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."supply_category_id" IS '供应分类ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."project_code" IS '项目号，针对按项目计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."order_no" IS '订单号，针对按订单计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."supplier_no" IS '供应商号，针对分供应商计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."demand_full_peg_flag" IS '1：表示需求数量必须小于等于供应数量才匹配，否则跳过该供应；0：表示不控制；默认0';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."instance_id" IS '实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."etl_batch_id" IS '集成批次号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."log_date" IS '记录时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."workbench_code" IS '页面工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."sim_workbench_code" IS '模拟工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."sim_period_code" IS '模拟期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."bl_period_code" IS '基线期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."bl_instance_id" IS '基线实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."bl_run_batch_id" IS '基线运行批次id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."update_type" IS '变更类型:append;update;delete;insert';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."p_id" IS 'pe_available_inventory表id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_available_inventory"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_sim_planning_demand_plan
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_planning_demand_plan";
CREATE TABLE "themetis_scp"."scp_sim_planning_demand_plan" (
  "id" int4 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_planning_demand_plan_id_seq'::regclass),
  "p_id" int8,
  "demand_plan_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_plan_line_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "project_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "order_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "required_quantity" numeric(20,6) NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_plan_type" varchar(50) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_bucket_start_date" timestamp(6) NOT NULL,
  "demand_bucket_end_date" timestamp(6),
  "demand_plan_priority" int8,
  "original_request_ship_date" timestamp(6),
  "plan_bucket_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "make_to_stock_type" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "full_kit_fulfillment_flag" bool,
  "netting_start_date" timestamp(6),
  "netting_end_date" timestamp(6),
  "demand_level_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_plan_category_id" int8,
  "workshop_no" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_consistency_group_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "lateness_tolerance_days" int4,
  "instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "etl_batch_id" int8,
  "log_date" timestamp(6),
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::bigint,
  "run_batch_id" int8,
  "load_date" timestamp(6),
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "contract_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "bl_run_batch_id" int8,
  "update_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr27" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr28" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr29" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr30" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr37" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr38" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr39" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr40" numeric(20,6) DEFAULT NULL::numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."p_id" IS 'pe_demand_plan 表id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_plan_no" IS '预测单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_plan_line_no" IS '预测行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."project_code" IS '项目号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."required_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."material_revision" IS '需求版本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_plan_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_bucket_start_date" IS '预测需求开始时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_bucket_end_date" IS '预测需求结束时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_plan_priority" IS '优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."original_request_ship_date" IS '原始需求时间，来自客户订单原始需求';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."plan_bucket_no" IS '计划时段单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."make_to_stock_type" IS '囤货订单标识';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."full_kit_fulfillment_flag" IS '是否齐套履行';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."netting_start_date" IS '被冲减向前范围';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."netting_end_date" IS '被冲减向后范围';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_level_no" IS '需求层级号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."demand_plan_category_id" IS '需求计划分类ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."workshop_no" IS '预测直接指定车间，可直接消耗车间仓库供应，并按车间冲减';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."supply_consistency_group_code" IS '供应一致性组号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."lateness_tolerance_days" IS '需求满足的容忍度天数, 容忍度内不认为late';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."instance_id" IS '实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."etl_batch_id" IS '集成批次号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."log_date" IS '记录时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."production_delivery_method" IS '生产交付模式，ETO，MTO，MTS（默认）';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."workbench_code" IS '页面工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."sim_workbench_code" IS '模拟工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."sim_period_code" IS '模拟期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."bl_period_code" IS '基线期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."bl_instance_id" IS '基线实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."bl_run_batch_id" IS '基线运行批次id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."update_type" IS '变更类型:append;update;delete;insert';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_demand_plan"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_sim_planning_purchase_order
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_planning_purchase_order";
CREATE TABLE "themetis_scp"."scp_sim_planning_purchase_order" (
  "id" int4 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_planning_purchase_order_id_seq'::regclass),
  "purchase_order_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "purchase_order_line_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "material" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "promise_delivery_date" timestamp(6),
  "required_quantity" numeric(20,6) DEFAULT NULL::numeric,
  "shipment_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_bucket_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_priority" int8,
  "supply_category_id" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "effective_start_date" timestamp(6),
  "effective_end_date" timestamp(6),
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "warehouse_no" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_full_peg_flag" bool,
  "project_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "order_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "etl_batch_id" int8,
  "log_date" timestamp(6),
  "tenant_id" int8 NOT NULL DEFAULT '-1'::bigint,
  "run_batch_id" int8,
  "load_date" timestamp(6),
  "contract_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "bl_run_batch_id" int8,
  "update_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr27" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr28" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr29" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr30" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr37" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr38" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr39" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr40" numeric(20,6) DEFAULT NULL::numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "p_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."purchase_order_no" IS '采购单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."purchase_order_line_no" IS '采购单行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."promise_delivery_date" IS '承诺到货时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."required_quantity" IS '数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."shipment_no" IS '发运行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."supply_bucket_no" IS '物料供应的计划时段单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."supply_priority" IS '供应优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."supply_category_id" IS '供应分类ID 供应分类ID SUPPLLIER_COMMITMENT代表供应商承诺 PO代表采购订单';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."effective_start_date" IS '供应生效时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."effective_end_date" IS '供应失效时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."warehouse_no" IS '到货入库仓库号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."supplier_no" IS '供应商号，针对分供应商计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."demand_full_peg_flag" IS '1：表示需求数量必须小于等于供应数量才匹配，否则跳过该供应；0：表示不控制；默认0';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."project_code" IS '项目号，针对按项目计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."order_no" IS '订单号，针对按订单计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."instance_id" IS '实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."etl_batch_id" IS '集成批次号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."log_date" IS '记录时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."workbench_code" IS '页面工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."sim_workbench_code" IS '模拟工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."sim_period_code" IS '模拟期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."bl_period_code" IS '基线期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."bl_instance_id" IS '基线实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."bl_run_batch_id" IS '基线运行批次id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."update_type" IS '变更类型:append;update;delete;insert';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."p_id" IS 'pe_purchase_order表id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_purchase_order"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_sim_planning_resource_capacity
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_planning_resource_capacity";
CREATE TABLE "themetis_scp"."scp_sim_planning_resource_capacity" (
  "id" int4 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_planning_resource_capacity_id_seq'::regclass),
  "p_id" int8,
  "resource_capacity_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "plan_bucket_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "capacity_quantity" numeric(20,6) DEFAULT NULL::numeric,
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "etl_batch_id" int8,
  "log_date" timestamp(6),
  "tenant_id" int8 NOT NULL DEFAULT '-1'::bigint,
  "run_batch_id" int8,
  "load_date" timestamp(6),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "bl_run_batch_id" int8,
  "update_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr27" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr28" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr29" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr30" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr37" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr38" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr39" numeric(20,6) DEFAULT NULL::numeric,
  "meta_attr40" numeric(20,6) DEFAULT NULL::numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."p_id" IS 'pe_resource_capacity 表id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."resource_capacity_no" IS '资源可用单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."resource_no" IS '资源单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."plan_bucket_no" IS '计划时段单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."capacity_quantity" IS '资源可用数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."instance_id" IS '实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."etl_batch_id" IS '集成批次号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."log_date" IS '记录时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."workbench_code" IS '页面工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."sim_workbench_code" IS '模拟工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."sim_period_code" IS '模拟期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."bl_period_code" IS '基线期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."bl_instance_id" IS '基线实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."bl_run_batch_id" IS '基线运行批次id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_resource_capacity"."update_type" IS '变更类型:append;update;delete;insert';

-- ----------------------------
-- Table structure for scp_sim_planning_sales_order
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_planning_sales_order";
CREATE TABLE "themetis_scp"."scp_sim_planning_sales_order" (
  "id" int4 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_planning_sales_order_id_seq'::regclass),
  "p_id" int8,
  "order_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_unit_code" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "order_line_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "schedule_line_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "required_quantity" numeric(20,6) NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "request_ship_date" timestamp(6),
  "schedule_ship_date" timestamp(6),
  "schedule_ship_quantity" numeric(20,6) DEFAULT NULL::numeric,
  "original_request_ship_date" timestamp(6),
  "demand_shipment_code" varchar(50) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "demand_priority" int8,
  "plan_bucket_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "make_to_stock_type" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "full_kit_fulfillment_flag" bool,
  "netting_start_date" timestamp(6),
  "netting_end_date" timestamp(6),
  "demand_level_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "sales_order_category_id" int8,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "contract_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "project_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "order_setup_type" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "workshop_no" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "supply_consistency_group_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "lateness_tolerance_days" int4,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "sim_workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_instance_id" varchar(30) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "etl_batch_id" int8,
  "log_date" timestamp(6),
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::bigint,
  "bl_run_batch_id" int8,
  "load_date" timestamp(6),
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "update_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "multi_unit_fulfillment_flag" bool,
  "instance_id" varchar(30) COLLATE "pg_catalog"."default",
  "run_batch_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."p_id" IS 'pe_sales_order 表id';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."order_no" IS '订单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."order_line_no" IS '订单行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."schedule_line_no" IS '发运行号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."required_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."material_revision" IS '需求版本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."request_ship_date" IS '需求时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."schedule_ship_date" IS '发运时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."schedule_ship_quantity" IS '发运数量';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."original_request_ship_date" IS '原始需求时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."demand_shipment_code" IS '齐套号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."demand_priority" IS '需求优先级';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."plan_bucket_no" IS '计划时段单号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."make_to_stock_type" IS '囤货订单标识';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."full_kit_fulfillment_flag" IS '是否齐套履行';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."netting_start_date" IS '冲减向前范围';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."netting_end_date" IS '冲减向后范围';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."demand_level_no" IS '需求层级号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."sales_order_category_id" IS '销售订单分类ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."customer_no" IS '客户号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."project_code" IS '项目号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."order_setup_type" IS '订单生产的准备类型，不同的订单准备类型导致切换时间成本';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."supplier_no" IS '供应商号，针对分供应商计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."workshop_no" IS '订单直接指定车间，可直接消耗车间仓库供应，并按车间冲减';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."supply_consistency_group_code" IS '供应一致性组号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."lateness_tolerance_days" IS '需求满足的容忍度天数, 容忍度内不认为late';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."workbench_code" IS '页面工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."sim_workbench_code" IS '模拟工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."sim_period_code" IS '模拟期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."bl_period_code" IS '基线期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."bl_instance_id" IS '基线实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."etl_batch_id" IS '集成批次号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."log_date" IS '记录时间';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."production_delivery_method" IS '生产交付模式，ETO，MTO，MTS（默认）';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."update_type" IS '变更类型:append;update;delete;insert';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."multi_unit_fulfillment_flag" IS '需求分工厂是否按比例分配';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."instance_id" IS '实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_planning_sales_order"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for scp_sim_scenario_period
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sim_scenario_period";
CREATE TABLE "themetis_scp"."scp_sim_scenario_period" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sim_scenario_period_id_seq'::regclass),
  "sim_scenario_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "runtime_workflow_id" int8,
  "bl_workflow_id" int8 NOT NULL,
  "bl_instance_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_run_batch_id" int8 NOT NULL,
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_workflow_id" int8 NOT NULL,
  "sim_instance_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_run_batch_id" int8,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."sim_scenario_code" IS '模拟场景代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."runtime_workflow_id" IS '模拟工作流实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."bl_workflow_id" IS '基线工作流ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."bl_instance_id" IS '基线引擎实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."bl_run_batch_id" IS '基线运行批次ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."bl_period_code" IS '基线期次代码';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."sim_workflow_id" IS '模拟工作流ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."sim_instance_id" IS '模拟引擎实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."sim_period_code" IS '模拟期次号';
COMMENT ON COLUMN "themetis_scp"."scp_sim_scenario_period"."sim_run_batch_id" IS '模拟运行批次ID';
COMMENT ON TABLE "themetis_scp"."scp_sim_scenario_period" IS '模拟场景期次';

-- ----------------------------
-- Table structure for scp_simulation_scenario
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_simulation_scenario";
CREATE TABLE "themetis_scp"."scp_simulation_scenario" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_simulation_scenario_id_seq'::regclass),
  "sim_scenario_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_scenario_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_workflow_id" int8 NOT NULL,
  "bl_instance_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "bl_run_batch_id" int8 NOT NULL,
  "bl_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "sim_workflow_id" int8 NOT NULL,
  "sim_instance_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "current_sim_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "delete_flag" bool NOT NULL DEFAULT false,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_scenario_code" IS '模拟场景代码';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_scenario_name" IS '模拟场景名称';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_workflow_id" IS '基线工作流ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_instance_id" IS '基线引擎实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_run_batch_id" IS '基线运行批次ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."bl_period_code" IS '基线期次代码';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_workflow_id" IS '模拟工作流ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."sim_instance_id" IS '模拟引擎实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_simulation_scenario"."current_sim_period_code" IS '当前期次代码';
COMMENT ON TABLE "themetis_scp"."scp_simulation_scenario" IS '模拟场景';

-- ----------------------------
-- Table structure for scp_sop_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sop_bucket_data";
CREATE TABLE "themetis_scp"."scp_sop_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sop_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON TABLE "themetis_scp"."scp_sop_bucket_data" IS 'DP需求预测bucket数据';

-- ----------------------------
-- Table structure for scp_sop_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sop_planning_item";
CREATE TABLE "themetis_scp"."scp_sop_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sop_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_sop_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON TABLE "themetis_scp"."scp_sop_planning_item" IS 'DP需求预测计划对象数据';

-- ----------------------------
-- Table structure for scp_sop_waterfall_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sop_waterfall_bucket_data";
CREATE TABLE "themetis_scp"."scp_sop_waterfall_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sop_waterfall_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "compare_planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "config_part_code" varchar(200) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."config_part_code" IS '配置项编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_bucket_data"."supply_center_code" IS '供应中心';
COMMENT ON TABLE "themetis_scp"."scp_sop_waterfall_bucket_data" IS 'DP需求预测bucket数据';

-- ----------------------------
-- Table structure for scp_sop_waterfall_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_sop_waterfall_planning_item";
CREATE TABLE "themetis_scp"."scp_sop_waterfall_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_sop_waterfall_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "config_part_code" varchar(200) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."config_part_code" IS '配置项编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_sop_waterfall_planning_item"."supply_center_code" IS '供应中心';
COMMENT ON TABLE "themetis_scp"."scp_sop_waterfall_planning_item" IS 'DP需求预测计划对象数据';

-- ----------------------------
-- Table structure for scp_ss_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_ss_bucket_data";
CREATE TABLE "themetis_scp"."scp_ss_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_ss_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."id" IS '自增序列号';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."approval_instance_id" IS '审批实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_ss_bucket_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_ss_bucket_data" IS '主需求计划-安全库存数据';

-- ----------------------------
-- Table structure for scp_ss_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_ss_planning_item";
CREATE TABLE "themetis_scp"."scp_ss_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_ss_planning_item_id_seq'::regclass),
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "safety_stock_profile_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "daily_demand_source_type" varchar(10) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 'HISTORY'::character varying,
  "daily_demand_days" int4 NOT NULL DEFAULT 14,
  "daily_demand_coefficient" numeric(10,4),
  "ss_demand_date_type" varchar(10) COLLATE "pg_catalog"."default" DEFAULT 'BUCKET_END'::character varying,
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."demand_source_type_code" IS '需求来源类型码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."safety_stock_profile_name" IS '安全库存配置名称';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."daily_demand_source_type" IS '天平均需求计算来源类型FUTURE/HISTORY';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."daily_demand_days" IS '天平均需求计算天数';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."daily_demand_coefficient" IS '天平均需求系数';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."ss_demand_date_type" IS '安全库存需求时点类型BUCKET_START/BUCKET_END';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_ss_planning_item"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."scp_ss_planning_item" IS '主需求计划-安全库存数据';

-- ----------------------------
-- Table structure for scp_summary_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_summary_data";
CREATE TABLE "themetis_scp"."scp_summary_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_summary_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "summary_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "summary_data_key" varchar(1000) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "sum_qty_21" numeric(20,6),
  "sum_qty_22" numeric(20,6),
  "sum_qty_23" numeric(20,6),
  "sum_qty_24" numeric(20,6),
  "sum_qty_25" numeric(20,6),
  "sum_qty_26" numeric(20,6),
  "sum_qty_27" numeric(20,6),
  "sum_qty_28" numeric(20,6),
  "sum_qty_29" numeric(20,6),
  "sum_qty_30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."summary_data_type_code" IS '汇总数据类型代码';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."summary_data_key" IS '汇总数据主键';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr01" IS '文本元属性1';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr02" IS '文本元属性2';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr03" IS '文本元属性3';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr04" IS '文本元属性4';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr05" IS '文本元属性5';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr06" IS '文本元属性6';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr07" IS '文本元属性7';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr08" IS '文本元属性8';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr09" IS '文本元属性9';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr10" IS '文本元属性10';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr11" IS '文本元属性11';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr12" IS '文本元属性12';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr13" IS '文本元属性13';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr14" IS '文本元属性14';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr15" IS '文本元属性15';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr16" IS '文本元属性16';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr17" IS '文本元属性17';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr18" IS '文本元属性18';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr19" IS '文本元属性19';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr20" IS '文本元属性20';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr21" IS '日期元属性21';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr22" IS '日期元属性22';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr23" IS '日期元属性23';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr24" IS '日期元属性24';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."meta_attr25" IS '日期元属性25';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_21" IS '汇总数量21';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_22" IS '汇总数量22';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_23" IS '汇总数量23';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_24" IS '汇总数量24';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_25" IS '汇总数量25';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_26" IS '汇总数量26';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_27" IS '汇总数量27';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_28" IS '汇总数量28';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_29" IS '汇总数量29';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."sum_qty_30" IS '汇总数量30';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data"."planning_period_code" IS '期次码';
COMMENT ON TABLE "themetis_scp"."scp_summary_data" IS '主需求计划数据';

-- ----------------------------
-- Table structure for scp_summary_data_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_summary_data_item";
CREATE TABLE "themetis_scp"."scp_summary_data_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_summary_data_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "summary_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attribute_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "summary_data_key" varchar(1000) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_item_id" int8 NOT NULL,
  "creation_date" timestamp(6) DEFAULT CURRENT_TIMESTAMP,
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."id" IS '自增主键';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."summary_data_type_code" IS '汇总数据类型代码';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."meta_attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."summary_data_key" IS '汇总数据主键';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."planning_item_id" IS '主数据对象ID';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."creation_date" IS '创建日期';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."last_update_date" IS '最后更新日期';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."created_by" IS '创建人';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."last_updated_by" IS '最后更新人';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_summary_data_item"."planning_period_code" IS '期次码';
COMMENT ON TABLE "themetis_scp"."scp_summary_data_item" IS '定义汇总数据与主数据对象关系';

-- ----------------------------
-- Table structure for scp_year_plan_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_year_plan_bucket_data";
CREATE TABLE "themetis_scp"."scp_year_plan_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_year_plan_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "phase_no" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "product_flag" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "material_desc" varchar(300) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."product_category_code" IS '产品编码，型号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data"."material_desc" IS '零部件名称';
COMMENT ON TABLE "themetis_scp"."scp_year_plan_bucket_data" IS '需求计划';

-- ----------------------------
-- Table structure for scp_year_plan_bucket_data_copy1
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_year_plan_bucket_data_copy1";
CREATE TABLE "themetis_scp"."scp_year_plan_bucket_data_copy1" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_year_plan_bucket_data_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "phase_no" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "product_flag" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "approval_instance_id" int8,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default",
  "head_id" int8,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."product_category_code" IS '产品编码，型号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."approval_instance_id" IS '审批实例ID,editable_flag=TRUE的figure_code才需要审批流实例';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_bucket_data_copy1"."planning_item_code" IS '计划对象编码';
COMMENT ON TABLE "themetis_scp"."scp_year_plan_bucket_data_copy1" IS '需求计划';

-- ----------------------------
-- Table structure for scp_year_plan_planning_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_year_plan_planning_item";
CREATE TABLE "themetis_scp"."scp_year_plan_planning_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_year_plan_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "product_flag" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "material_desc" varchar(300) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."supply_unit_code" IS '工艺场所';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item"."material_desc" IS '零部件名称';
COMMENT ON TABLE "themetis_scp"."scp_year_plan_planning_item" IS '需求计划对象数据';

-- ----------------------------
-- Table structure for scp_year_plan_planning_item_copy1
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_year_plan_planning_item_copy1";
CREATE TABLE "themetis_scp"."scp_year_plan_planning_item_copy1" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_year_plan_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "material" varchar(200) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "product_flag" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(200) COLLATE "pg_catalog"."default",
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."supply_unit_code" IS '工艺场所';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."product_flag" IS '版本标记';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."revision_operator" IS '版本操作符';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."status" IS '状态：Draft,In Approval Process,Published,Reject';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."product_hierarchy_path" IS '产品树路径';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."planning_item_code" IS '计划对象编码';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_year_plan_planning_item_copy1"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON TABLE "themetis_scp"."scp_year_plan_planning_item_copy1" IS '需求计划对象数据';

-- ----------------------------
-- Table structure for sy_scp_ecn
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."sy_scp_ecn";
CREATE TABLE "themetis_scp"."sy_scp_ecn" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".sy_scp_ecn_id_seq'::regclass),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "final_doc" int8,
  "material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "ecn_no" varchar(200) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT ON COLUMN "themetis_scp"."sy_scp_ecn"."id" IS '自增长ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ecn"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ecn"."final_doc" IS '变更单报告';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ecn"."material" IS '物料编码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ecn"."ecn_no" IS '变更单号';
COMMENT ON TABLE "themetis_scp"."sy_scp_ecn" IS '审批日志';

-- ----------------------------
-- Table structure for sy_scp_fai
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."sy_scp_fai";
CREATE TABLE "themetis_scp"."sy_scp_fai" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".sy_scp_fai_id_seq'::regclass),
  "fai_type" varchar(20) COLLATE "pg_catalog"."default",
  "approval_doc" int8,
  "final_confirm" varchar(20) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "final_doc" int8,
  "approval_flow_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "ecn_no" varchar(200) COLLATE "pg_catalog"."default",
  "is_fai" varchar(10) COLLATE "pg_catalog"."default",
  "kit_number" varchar(100) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."id" IS '自增长ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."fai_type" IS '首件鉴定类型';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."approval_doc" IS '质量报告';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."final_confirm" IS '确认';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."final_doc" IS '总结报告';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."approval_flow_code" IS '审批流代码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."material" IS '物料编码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."ecn_no" IS '变更单号';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."is_fai" IS '是否为首件鉴定';
COMMENT ON COLUMN "themetis_scp"."sy_scp_fai"."kit_number" IS '台份号';
COMMENT ON TABLE "themetis_scp"."sy_scp_fai" IS '审批日志';

-- ----------------------------
-- Table structure for sy_scp_ied_inventory_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."sy_scp_ied_inventory_bucket_data";
CREATE TABLE "themetis_scp"."sy_scp_ied_inventory_bucket_data" (
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "figure_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "source_workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "source_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "source_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".sy_scp_ied_inventory_bucket_data_id_seq'::regclass),
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default",
  "head_id" int8
)
;
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."figure_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."source_workbench_code" IS '来源工作台代码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."source_figure_group_code" IS '来源维度组';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."source_figure_code" IS '来源数据维度码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."source_period_type_code" IS '来源期次类型码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."source_period_code" IS '来源期次码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_bucket_data"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON TABLE "themetis_scp"."sy_scp_ied_inventory_bucket_data" IS '需求计划';

-- ----------------------------
-- Table structure for sy_scp_ied_inventory_item
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."sy_scp_ied_inventory_item";
CREATE TABLE "themetis_scp"."sy_scp_ied_inventory_item" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_dp_planning_item_id_seq'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(200) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL,
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "lock_version" int2 NOT NULL DEFAULT 0,
  "aggregated_type" varchar(30) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_item"."workbench_code" IS '工作台代码，外键';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_item"."planning_period_type_code" IS '期次类型码，外键';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_item"."planning_period_code" IS '期次码，外键';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_item"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_item"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."sy_scp_ied_inventory_item"."aggregated_type" IS 'NONE;MATERIAL_GROUP;PRODUCT_CATEGORY;SUPPLY_UNIT';
COMMENT ON TABLE "themetis_scp"."sy_scp_ied_inventory_item" IS '需求计划对象数据';

-- ----------------------------
-- Table structure for sy_scp_order_task
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."sy_scp_order_task";
CREATE TABLE "themetis_scp"."sy_scp_order_task" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".sy_order_task_id_seq'::regclass),
  "order_no" text COLLATE "pg_catalog"."default" NOT NULL,
  "task_operation_type_no" int4 NOT NULL,
  "task_operation_type_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "task_operation_no" int4 NOT NULL,
  "task_operation_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "task_operation_duration" int4,
  "task_operation_from_date" date,
  "task_operation_to_date" date,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "default_flag" bool,
  "task_operation_type_position" varchar(20) COLLATE "pg_catalog"."default",
  "task_operation_deliverable" varchar(50) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(50) COLLATE "pg_catalog"."default",
  "is_packing_flag" bool DEFAULT false
)
;
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."order_no" IS '单据号。默认对应计划工单号，也可以是其他单据号';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_type_no" IS '工序类型序号';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_type_name" IS '工序类型名称';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_no" IS '工序步骤序号';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_name" IS '工序步骤名称';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_duration" IS '工序工期(天)';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_from_date" IS '工序开始日期';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_to_date" IS '工序结束日期';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."remarks" IS '备注';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."default_flag" IS '默认选择标记';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_type_position" IS '工序位置：前置任务；后置任务';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."task_operation_deliverable" IS '交付形式：文件;实物';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."supply_unit_code" IS '工艺厂所';
COMMENT ON COLUMN "themetis_scp"."sy_scp_order_task"."is_packing_flag" IS '总装标记';

-- ----------------------------
-- Table structure for sy_scp_tran_phase
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."sy_scp_tran_phase";
CREATE TABLE "themetis_scp"."sy_scp_tran_phase" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".sy_scp_tran_phase_id_seq'::regclass),
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "current_phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "next_phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "approval_confirm" varchar(20) COLLATE "pg_catalog"."default",
  "approval_doc" int8,
  "final_confirm" varchar(20) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "lock_version" int2 NOT NULL DEFAULT 0,
  "final_doc" int8,
  "approval_flow_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."id" IS '自增长ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."current_phase_no" IS '当前阶段';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."next_phase_no" IS '下一阶段';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."approval_confirm" IS '评审确认';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."approval_doc" IS '评审文档';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."final_confirm" IS '总结确认';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."final_doc" IS '总结文档';
COMMENT ON COLUMN "themetis_scp"."sy_scp_tran_phase"."approval_flow_code" IS '审批流代码';
COMMENT ON TABLE "themetis_scp"."sy_scp_tran_phase" IS '审批日志';

-- ----------------------------
-- Table structure for tmp$scp_raw_pegging_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."tmp$scp_raw_pegging_bucket_data";
CREATE TABLE "themetis_scp"."tmp$scp_raw_pegging_bucket_data" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp"."tmp$scp_raw_pegging_bucket_data_id_seq"'::regclass),
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_order_no" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_line_no" varchar(1000) COLLATE "pg_catalog"."default",
  "demand_order_material" varchar(200) COLLATE "pg_catalog"."default",
  "demand_order_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "product_material" varchar(200) COLLATE "pg_catalog"."default",
  "bucket_from_date" date,
  "bucket_to_date" date,
  "bucket_date" date,
  "bucket_field" varchar(50) COLLATE "pg_catalog"."default",
  "bucket_qty" numeric(20,6),
  "material_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_path" varchar(1000) COLLATE "pg_catalog"."default",
  "accumulated_leadtime" numeric(20,6),
  "accum_bom_qty_per" numeric(20,6),
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "json_obj" jsonb,
  "tenant_id" int4,
  "log_date" timestamp(0) DEFAULT now(),
  "group_code" varchar(400) COLLATE "pg_catalog"."default",
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."tmp$scp_raw_pegging_bucket_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."tmp$scp_raw_pegging_bucket_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."tmp$scp_raw_pegging_bucket_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."tmp$scp_raw_pegging_bucket_data"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for tmp_mds_sim_priority
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."tmp_mds_sim_priority";
CREATE TABLE "themetis_scp"."tmp_mds_sim_priority" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".tmp_mds_sim_priority_id_seq'::regclass),
  "demand_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default",
  "planning_period_type_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_period_code" varchar(100) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "figure_code" varchar(100) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(1000) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "order_setup_type" varchar(30) COLLATE "pg_catalog"."default",
  "required_quantity" numeric(20,6),
  "bucket_start_date" timestamp(6),
  "bucket_end_date" timestamp(6),
  "original_demand_priority" int8,
  "sim_demand_priority" int8,
  "revision_operator" varchar(30) COLLATE "pg_catalog"."default",
  "full_kit_fulfillment_flag" bool,
  "supply_consistency_group_code" varchar(100) COLLATE "pg_catalog"."default",
  "safety_stock_profile_name" varchar(100) COLLATE "pg_catalog"."default",
  "ss_demand_date_type" varchar(10) COLLATE "pg_catalog"."default",
  "sales_order_category_id" int8,
  "workshop_no" varchar(30) COLLATE "pg_catalog"."default",
  "make_to_stock_type" varchar(30) COLLATE "pg_catalog"."default",
  "demand_source_type_code" varchar(100) COLLATE "pg_catalog"."default",
  "demand_level_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "demand_shipment_code" varchar(50) COLLATE "pg_catalog"."default",
  "planning_item_code" varchar(30) COLLATE "pg_catalog"."default",
  "daily_demand_source_type" varchar(10) COLLATE "pg_catalog"."default",
  "daily_demand_days" int4,
  "daily_demand_coefficient" numeric(10,4),
  "plan_bucket_no" varchar(100) COLLATE "pg_catalog"."default",
  "netting_start_date" timestamp(6),
  "netting_end_date" timestamp(6),
  "schedule_line_no" varchar(100) COLLATE "pg_catalog"."default",
  "schedule_ship_date" timestamp(6),
  "schedule_ship_quantity" numeric(20,6),
  "request_ship_date" timestamp(6),
  "lateness_tolerance_days" int4,
  "multi_unit_fulfillment_flag" bool,
  "original_request_ship_date" timestamp(6),
  "original_order_line_id" int8,
  "order_status" varchar(30) COLLATE "pg_catalog"."default",
  "promised_ship_date" timestamp(6),
  "suggested_demand_priority" int8,
  "top_priority_flag" bool,
  "customer_type" varchar(50) COLLATE "pg_catalog"."default",
  "emergency_type" int4,
  "profitable_level" int4,
  "order_type_code" varchar(30) COLLATE "pg_catalog"."default",
  "shipped_quantity" numeric(20,6),
  "actual_ship_date" timestamp(6),
  "customer_order_date" timestamp(6),
  "source_system" varchar(50) COLLATE "pg_catalog"."default",
  "location_code" varchar(100) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."tmp_mds_sim_priority"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."tmp_mds_sim_priority"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."tmp_mds_sim_priority"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."tmp_mds_sim_priority"."product_flag" IS '版本标记';

-- ----------------------------
-- Table structure for wb_custom_master_data_type
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_custom_master_data_type";
CREATE TABLE "themetis_scp"."wb_custom_master_data_type" (
  "tenant_id" int8 NOT NULL,
  "master_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "master_data_type_name" varchar(100) COLLATE "pg_catalog"."default",
  "master_data_type_desc" varchar(400) COLLATE "pg_catalog"."default",
  "privilege_group_code" varchar(30) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_custom_master_data_type"."master_data_type_code" IS '主数据代码';
COMMENT ON COLUMN "themetis_scp"."wb_custom_master_data_type"."master_data_type_name" IS '主数据名称';
COMMENT ON COLUMN "themetis_scp"."wb_custom_master_data_type"."master_data_type_desc" IS '主数据描述';
COMMENT ON COLUMN "themetis_scp"."wb_custom_master_data_type"."privilege_group_code" IS '特殊权限控制组代码';
COMMENT ON TABLE "themetis_scp"."wb_custom_master_data_type" IS '自定义主数据类型';

-- ----------------------------
-- Table structure for wb_custom_meta_attribute
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_custom_meta_attribute";
CREATE TABLE "themetis_scp"."wb_custom_meta_attribute" (
  "tenant_id" int8 NOT NULL,
  "meta_attribute_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attribute_name" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attribute_desc" varchar(400) COLLATE "pg_catalog"."default",
  "privilege_group_code" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_type" varchar(30) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_custom_meta_attribute"."meta_attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."wb_custom_meta_attribute"."meta_attribute_name" IS '属性名称';
COMMENT ON COLUMN "themetis_scp"."wb_custom_meta_attribute"."meta_attribute_desc" IS '属性描述';
COMMENT ON COLUMN "themetis_scp"."wb_custom_meta_attribute"."privilege_group_code" IS '特殊权限控制组代码';
COMMENT ON COLUMN "themetis_scp"."wb_custom_meta_attribute"."attribute_type" IS '默认Char，可以是：Number，Datetime';
COMMENT ON TABLE "themetis_scp"."wb_custom_meta_attribute" IS '自定义属性集合';

-- ----------------------------
-- Table structure for wb_custom_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_custom_order_data";
CREATE TABLE "themetis_scp"."wb_custom_order_data" (
  "tenant_id" int8 NOT NULL,
  "order_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default",
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default",
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr21" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr22" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr23" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr24" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr25" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr26" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr27" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr28" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr29" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr30" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr31" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr32" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr33" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr34" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr35" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr36" text COLLATE "pg_catalog"."default",
  "meta_attr37" text COLLATE "pg_catalog"."default",
  "meta_attr38" text COLLATE "pg_catalog"."default",
  "meta_attr39" text COLLATE "pg_catalog"."default",
  "meta_attr40" text COLLATE "pg_catalog"."default",
  "meta_attr41" timestamp(6),
  "meta_attr42" timestamp(6),
  "meta_attr43" timestamp(6),
  "meta_attr44" timestamp(6),
  "meta_attr45" timestamp(6),
  "meta_attr46" timestamp(6),
  "meta_attr47" timestamp(6),
  "meta_attr48" timestamp(6),
  "meta_attr49" timestamp(6),
  "meta_attr50" timestamp(6),
  "meta_attr51" numeric(20,6),
  "meta_attr52" numeric(20,6),
  "meta_attr53" numeric(20,6),
  "meta_attr54" numeric(20,6),
  "meta_attr55" numeric(20,6),
  "meta_attr56" numeric(20,6),
  "meta_attr57" numeric(20,6),
  "meta_attr58" numeric(20,6),
  "meta_attr59" numeric(20,6),
  "meta_attr60" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."order_data_type_code" IS '单据数据代码';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."order_data_key" IS '单据数据键值';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON TABLE "themetis_scp"."wb_custom_order_data" IS '单据数据类型实际数据';

-- ----------------------------
-- Table structure for wb_custom_order_data_type
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_custom_order_data_type";
CREATE TABLE "themetis_scp"."wb_custom_order_data_type" (
  "tenant_id" int8 NOT NULL,
  "order_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_type_name" varchar(100) COLLATE "pg_catalog"."default",
  "order_data_type_desc" varchar(400) COLLATE "pg_catalog"."default",
  "privilege_group_code" varchar(30) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data_type"."order_data_type_code" IS '单据数据代码';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data_type"."order_data_type_name" IS '单据数据名称';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data_type"."order_data_type_desc" IS '单据数据描述';
COMMENT ON COLUMN "themetis_scp"."wb_custom_order_data_type"."privilege_group_code" IS '特殊权限控制组代码';
COMMENT ON TABLE "themetis_scp"."wb_custom_order_data_type" IS '自定义单据数据类型';

-- ----------------------------
-- Table structure for wb_custom_query
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_custom_query";
CREATE TABLE "themetis_scp"."wb_custom_query" (
  "id" int8 NOT NULL,
  "directory_id" int8,
  "query_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "query_desc" varchar(100) COLLATE "pg_catalog"."default",
  "query_type" varchar(50) COLLATE "pg_catalog"."default",
  "delete_flag" varchar(1) COLLATE "pg_catalog"."default" NOT NULL,
  "created_by" int8,
  "creation_date" timestamp(6) NOT NULL,
  "last_updated_by" int8,
  "last_update_date" timestamp(6) NOT NULL
)
;
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."id" IS '主键';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."directory_id" IS '目录ID';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."query_name" IS '查询报表名称';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."query_desc" IS '报表描述';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."query_type" IS '报表类型：单表  父子表';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."delete_flag" IS '删除';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."created_by" IS '创建人';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."creation_date" IS '创建时间';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."last_updated_by" IS '更新人';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query"."last_update_date" IS '更新时间';
COMMENT ON TABLE "themetis_scp"."wb_custom_query" IS '自定义查询';

-- ----------------------------
-- Table structure for wb_custom_query_condition
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_custom_query_condition";
CREATE TABLE "themetis_scp"."wb_custom_query_condition" (
  "id" int8 NOT NULL,
  "custom_query_config_id" int8 NOT NULL,
  "condition_parameter" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "condition_field" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "condition_input_mode" varchar(20) COLLATE "pg_catalog"."default",
  "connect_parent_field" varchar(50) COLLATE "pg_catalog"."default",
  "operator" varchar(20) COLLATE "pg_catalog"."default",
  "condition_name" varchar(50) COLLATE "pg_catalog"."default",
  "condition_type" varchar(10) COLLATE "pg_catalog"."default",
  "enum_value" varchar(100) COLLATE "pg_catalog"."default",
  "default_value" varchar(100) COLLATE "pg_catalog"."default",
  "is_required" varchar(10) COLLATE "pg_catalog"."default",
  "is_multiple" varchar(10) COLLATE "pg_catalog"."default",
  "order_by" varchar(10) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "delete_flag" varchar(1) COLLATE "pg_catalog"."default" NOT NULL,
  "created_by" int8,
  "creation_date" timestamp(6) NOT NULL,
  "last_updated_by" int8,
  "last_update_date" timestamp(6) NOT NULL
)
;
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."id" IS '主键';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."custom_query_config_id" IS '自定义查询条件配置ID';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."condition_parameter" IS '条件参数';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."condition_field" IS '条件参数';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."condition_input_mode" IS '条件输入方式： 关联父表  手工输入';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."connect_parent_field" IS '关联父表字段';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."operator" IS '比较条件：> < = between in';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."condition_name" IS '条件名称';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."condition_type" IS '条件类型： 数字 文本 时间';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."enum_value" IS '枚举值';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."default_value" IS '默认值';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."is_required" IS '是否必填： 是 Y 否 N';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."is_multiple" IS '是否多选： 是 Y 否 N';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."order_by" IS '排序';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."remark" IS '备注';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."delete_flag" IS '删除';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."created_by" IS '创建人';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."creation_date" IS '创建时间';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."last_updated_by" IS '更新人';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_condition"."last_update_date" IS '更新时间';
COMMENT ON TABLE "themetis_scp"."wb_custom_query_condition" IS '自定义查询配置条件表';

-- ----------------------------
-- Table structure for wb_custom_query_config
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_custom_query_config";
CREATE TABLE "themetis_scp"."wb_custom_query_config" (
  "id" int8 NOT NULL,
  "custom_query_id" int8 NOT NULL,
  "parent_id" int8,
  "original_sql" varchar(2000) COLLATE "pg_catalog"."default",
  "exec_sql" varchar(2000) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "delete_flag" varchar(1) COLLATE "pg_catalog"."default" NOT NULL,
  "created_by" int8,
  "creation_date" timestamp(6) NOT NULL,
  "last_updated_by" int8,
  "last_update_date" timestamp(6) NOT NULL
)
;
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."id" IS '主键';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."custom_query_id" IS '自定义查询ID';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."parent_id" IS '父ID';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."original_sql" IS '原始SQL';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."exec_sql" IS '执行SQL';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."remark" IS '备注';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."delete_flag" IS '删除';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."created_by" IS '创建人';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."creation_date" IS '创建时间';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."last_updated_by" IS '更新人';
COMMENT ON COLUMN "themetis_scp"."wb_custom_query_config"."last_update_date" IS '更新时间';
COMMENT ON TABLE "themetis_scp"."wb_custom_query_config" IS '自定义查询报表配置';

-- ----------------------------
-- Table structure for wb_data_source
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_data_source";
CREATE TABLE "themetis_scp"."wb_data_source" (
  "tenant_id" int8 NOT NULL,
  "data_source_code" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "data_source_table" varchar(100) COLLATE "pg_catalog"."default",
  "data_source_sql" text COLLATE "pg_catalog"."default",
  "data_source_type" varchar(10) COLLATE "pg_catalog"."default" NOT NULL,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_data_source"."data_source_code" IS '数据源代码';
COMMENT ON COLUMN "themetis_scp"."wb_data_source"."data_source_table" IS '数据源表';
COMMENT ON COLUMN "themetis_scp"."wb_data_source"."data_source_sql" IS '数据源查询SQL';
COMMENT ON COLUMN "themetis_scp"."wb_data_source"."data_source_type" IS '数据源类型，Table或者SQL，2选1';
COMMENT ON TABLE "themetis_scp"."wb_data_source" IS '数据源';

-- ----------------------------
-- Table structure for wb_demand_network
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_demand_network";
CREATE TABLE "themetis_scp"."wb_demand_network" (
  "tenant_id" int8 NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_name" varchar(100) COLLATE "pg_catalog"."default",
  "demand_network_desc" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_demand_network"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_demand_network"."demand_network_name" IS '需求计划网络名称';
COMMENT ON COLUMN "themetis_scp"."wb_demand_network"."demand_network_desc" IS '需求计划网络描述';
COMMENT ON TABLE "themetis_scp"."wb_demand_network" IS '需求网络头';

-- ----------------------------
-- Table structure for wb_demand_plan_md_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_demand_plan_md_data";
CREATE TABLE "themetis_scp"."wb_demand_plan_md_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "master_data_key" varchar(400) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."master_data_key" IS '主数据键值,用于与bucket数据关联';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_demand_plan_md_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_demand_plan_md_data" IS '需求计划主数据，默认主数据类型';

-- ----------------------------
-- Table structure for wb_demand_supply_route
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_demand_supply_route";
CREATE TABLE "themetis_scp"."wb_demand_supply_route" (
  "tenant_id" int8 NOT NULL,
  "supply_route_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_rate" numeric(10,4) NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_demand_supply_route"."supply_route_code" IS '供应路径代码';
COMMENT ON COLUMN "themetis_scp"."wb_demand_supply_route"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_demand_supply_route"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_demand_supply_route"."supply_network_code" IS '供应网络代码';
COMMENT ON COLUMN "themetis_scp"."wb_demand_supply_route"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_demand_supply_route"."supply_rate" IS '供应比例';
COMMENT ON COLUMN "themetis_scp"."wb_demand_supply_route"."product_category_code" IS '产品分类码';
COMMENT ON TABLE "themetis_scp"."wb_demand_supply_route" IS '产品供应地图';

-- ----------------------------
-- Table structure for wb_demand_unit
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_demand_unit";
CREATE TABLE "themetis_scp"."wb_demand_unit" (
  "tenant_id" int8 NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_name" varchar(100) COLLATE "pg_catalog"."default",
  "demand_unit_desc" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit"."demand_unit_name" IS '需求计划单元名称';
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit"."demand_unit_desc" IS '需求计划单元描述';
COMMENT ON TABLE "themetis_scp"."wb_demand_unit" IS '需求单元';

-- ----------------------------
-- Table structure for wb_demand_unit_hierarchy
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_demand_unit_hierarchy";
CREATE TABLE "themetis_scp"."wb_demand_unit_hierarchy" (
  "tenant_id" int8 NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "parent_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "sum_up_rate" numeric(10,4) NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit_hierarchy"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit_hierarchy"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit_hierarchy"."parent_unit_code" IS '父需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_demand_unit_hierarchy"."sum_up_rate" IS '计划卷积比例';
COMMENT ON TABLE "themetis_scp"."wb_demand_unit_hierarchy" IS '需求单元层级';

-- ----------------------------
-- Table structure for wb_dp_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_dp_bucket_data";
CREATE TABLE "themetis_scp"."wb_dp_bucket_data" (
  "tenant_id" int8 NOT NULL,
  "master_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."master_data_key" IS '主数据键值,用于与主数据关联';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."figure_type_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."wb_dp_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON TABLE "themetis_scp"."wb_dp_bucket_data" IS '需求计划bucket数据，按内置主数据类型分表，提升性能';

-- ----------------------------
-- Table structure for wb_fcst_fulfillment_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_fcst_fulfillment_order_data";
CREATE TABLE "themetis_scp"."wb_fcst_fulfillment_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_plan_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_plan_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "fulfillment_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "fulfillment_level_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "demand_date" timestamp(6) NOT NULL,
  "demand_quantity" numeric(20,6),
  "supply_date" timestamp(6),
  "supply_quantity" numeric(20,6) NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."demand_plan_no" IS '预测单号';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."demand_plan_line_no" IS '预测行号';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."fulfillment_line_no" IS '履行计划行号，即展开后的展开行号';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."fulfillment_level_no" IS '展开层次号';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."material_revision" IS '需求版本';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."demand_date" IS '需求时间';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."demand_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."supply_date" IS '供应时间';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."supply_quantity" IS '供应数量';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."status" IS '状态：Fulfilled，Late，Short';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_fcst_fulfillment_order_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_fcst_fulfillment_order_data" IS '预测需求履行明细单据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_figure_type
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_figure_type";
CREATE TABLE "themetis_scp"."wb_figure_type" (
  "tenant_id" int8 NOT NULL,
  "figure_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_type_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "data_source_code" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "bucketized_field" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "primary_key_field1" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "primary_key_field2" varchar(30) COLLATE "pg_catalog"."default",
  "primary_key_field3" varchar(30) COLLATE "pg_catalog"."default",
  "primary_key_field4" varchar(30) COLLATE "pg_catalog"."default",
  "primary_key_field5" varchar(30) COLLATE "pg_catalog"."default",
  "derived_figure_flag" int2 NOT NULL,
  "computational_formula" varchar(400) COLLATE "pg_catalog"."default",
  "negative_to_zero_flag" int2 NOT NULL,
  "null_to_zero_flag" int2 NOT NULL,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."figure_type_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."figure_type_name" IS '数据维度名称';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."data_source_code" IS '数据源代码，取值自数据源定义';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."bucketized_field" IS 'bucket计算字段，取值自数据源定义中的时间字段';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."primary_key_field1" IS '数据源主键1，取值自数据源定义中的字段,所有数据源主键组合后与主数据对象关联';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."primary_key_field2" IS '数据源主键2，取值自数据源定义中的字段';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."primary_key_field3" IS '数据源主键3，取值自数据源定义中的字段';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."primary_key_field4" IS '数据源主键4，取值自数据源定义中的字段';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."primary_key_field5" IS '数据源主键5，取值自数据源定义中的字段';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."derived_figure_flag" IS '是否由其他数据维度计算';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."computational_formula" IS '计算公式，用figure_type_code进行组函数表示MAX，MIN，AVG，SUM，或者+-*/运算';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."negative_to_zero_flag" IS '是否负数自动调整为0';
COMMENT ON COLUMN "themetis_scp"."wb_figure_type"."null_to_zero_flag" IS '是否空值自动赋0';
COMMENT ON TABLE "themetis_scp"."wb_figure_type" IS '数据维度';

-- ----------------------------
-- Table structure for wb_forecast_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_forecast_order_data";
CREATE TABLE "themetis_scp"."wb_forecast_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_plan_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_plan_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "required_quantity" numeric(20,6),
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "demand_plan_type" varchar(50) COLLATE "pg_catalog"."default",
  "demand_bucket_start_date" timestamp(6),
  "demand_bucket_end_date" timestamp(6),
  "demand_plan_priority" int8,
  "original_request_ship_date" timestamp(6),
  "plan_bucket_no" varchar(100) COLLATE "pg_catalog"."default",
  "planned_fulfillment_date" timestamp(6),
  "planned_fulfillment_quantity" numeric(20,6) NOT NULL,
  "demand_level_no" varchar(100) COLLATE "pg_catalog"."default",
  "demand_plan_category_id" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_plan_no" IS '预测单号';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_plan_line_no" IS '预测行号';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."project_code" IS '项目号';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."order_no" IS '订单号，针对订单拆分为需求计划场景';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."required_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."material_revision" IS '需求版本';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_plan_type" IS '需求类型';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_bucket_start_date" IS '预测需求开始时间';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_bucket_end_date" IS '预测需求结束时间';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_plan_priority" IS '优先级';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."original_request_ship_date" IS '原始需求时间，来自客户订单原始需求';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."plan_bucket_no" IS '计划时段单号';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."planned_fulfillment_date" IS '计划满足时间';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."planned_fulfillment_quantity" IS '计划满足数量';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_level_no" IS '需求层级号';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."demand_plan_category_id" IS '需求分类ID';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_forecast_order_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_forecast_order_data" IS '预测需求单据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_item_supply_path
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_item_supply_path";
CREATE TABLE "themetis_scp"."wb_item_supply_path" (
  "tenant_id" int8 NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_path_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "to_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "from_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "distribution_priority" int8,
  "distribution_ratio" numeric(8,6),
  "distribution_type" varchar(50) COLLATE "pg_catalog"."default",
  "distribution_lead_time" numeric(20,6),
  "min_lot_size" numeric(20,6),
  "max_lot_size" numeric(20,6),
  "lot_size_multiple" numeric(20,6),
  "consolidation_days" int4,
  "lateness_tolerance" int4,
  "effective_start_date" timestamp(6),
  "effective_end_date" timestamp(6),
  "unit_distribution_cost" numeric(20,6),
  "fix_distribution_cost" numeric(20,6),
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."supply_network_code" IS '供应网络代码';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."supply_path_code" IS '供应路径代码';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."to_unit_code" IS '需求方计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."from_unit_code" IS '供应方计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."distribution_priority" IS '优先级';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."distribution_ratio" IS '分销比例';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."distribution_type" IS '分销类型';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."distribution_lead_time" IS '分销周期';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."min_lot_size" IS '最小批量';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."max_lot_size" IS '最大批量';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."lot_size_multiple" IS '批量倍数';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."lateness_tolerance" IS '容忍度';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."effective_start_date" IS '生效时间';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."effective_end_date" IS '失效时间';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."unit_distribution_cost" IS '单位转运成本';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."fix_distribution_cost" IS '固定转运成本';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_item_supply_path"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_item_supply_path" IS '物料供应路径';

-- ----------------------------
-- Table structure for wb_master_data_type_attribute
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_master_data_type_attribute";
CREATE TABLE "themetis_scp"."wb_master_data_type_attribute" (
  "tenant_id" int8 NOT NULL,
  "master_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "ref_master_data_type1" varchar(100) COLLATE "pg_catalog"."default",
  "ref_master_data_type2" varchar(100) COLLATE "pg_catalog"."default",
  "ref_master_data_type3" varchar(100) COLLATE "pg_catalog"."default",
  "ref_master_data_type4" varchar(100) COLLATE "pg_catalog"."default",
  "ref_master_data_type5" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attribute_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "data_column" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "key_attribute_flag" int2,
  "query_condition_flag" int2,
  "default_order_by_flag" int2,
  "data_source_url" varchar(1000) COLLATE "pg_catalog"."default",
  "prompt_up_flag" int2,
  "prompt_up_md_type" varchar(100) COLLATE "pg_catalog"."default",
  "prompt_up_parameter" varchar(500) COLLATE "pg_catalog"."default",
  "mouse_on_tips" varchar(100) COLLATE "pg_catalog"."default",
  "privilege_group_code" varchar(30) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."master_data_type_code" IS '主数据代码，如果是内置主数据，则用表名：如wb_demand_plan_md_data';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."ref_master_data_type1" IS '引用其他主数据代码1';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."ref_master_data_type2" IS '引用其他主数据代码2';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."ref_master_data_type3" IS '引用其他主数据代码3';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."ref_master_data_type4" IS '引用其他主数据代码4';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."ref_master_data_type5" IS '引用其他主数据代码5';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."meta_attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."data_column" IS 'wb_custom_md_data及内置主数据表如wb_demand_plan_md_data中对应的属性字段';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."key_attribute_flag" IS '是否主键字段，如果是主键字段，自动加入为master_data_key的一部分';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."query_condition_flag" IS '是否查询条件字段';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."default_order_by_flag" IS '默认排序字段';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."data_source_url" IS '数据来源服务url';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."prompt_up_flag" IS '字段值是否链接弹出窗口';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."prompt_up_md_type" IS '字段值弹出对应的主数据类型';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."prompt_up_parameter" IS '字段值弹出对应的参数取值，引用主数据的其他字段';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."mouse_on_tips" IS '鼠标悬停提示内容';
COMMENT ON COLUMN "themetis_scp"."wb_master_data_type_attribute"."privilege_group_code" IS '特殊权限控制组代码';
COMMENT ON TABLE "themetis_scp"."wb_master_data_type_attribute" IS '自定义主数据属性关系';

-- ----------------------------
-- Table structure for wb_master_plan_md_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_master_plan_md_data";
CREATE TABLE "themetis_scp"."wb_master_plan_md_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "master_data_key" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."master_data_key" IS '主数据键值,用于与bucket数据关联';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_master_plan_md_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_master_plan_md_data" IS '主计划主数据，默认主数据类型';

-- ----------------------------
-- Table structure for wb_material
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_material";
CREATE TABLE "themetis_scp"."wb_material" (
  "tenant_id" int8 NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "critical_flag" int2,
  "revision_enable_flag" int2,
  "attribute_enable_flag" int2,
  "supply_action_type" varchar(50) COLLATE "pg_catalog"."default",
  "production_supply_type" varchar(50) COLLATE "pg_catalog"."default",
  "production_version_mode" int2,
  "production_consolidation_days" int4,
  "mix_substitution_mode" int2,
  "use_up_flag" int2,
  "demand_driven_type" varchar(30) COLLATE "pg_catalog"."default",
  "supply_priority_type" varchar(100) COLLATE "pg_catalog"."default",
  "unit_cost" numeric(20,6),
  "storage_cost" numeric(20,6),
  "unit_late_cost" numeric(20,6),
  "unit_shortage_cost" numeric(20,6),
  "unit_early_cost" numeric(20,6),
  "precision" numeric(20,6),
  "sourcing_code" int4,
  "routing_enable_flag" int2,
  "planning_time_fence" int4,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_material"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_material"."attribute_code" IS '属性码';
COMMENT ON COLUMN "themetis_scp"."wb_material"."critical_flag" IS '关键物料标识';
COMMENT ON COLUMN "themetis_scp"."wb_material"."revision_enable_flag" IS '版本启用标识';
COMMENT ON COLUMN "themetis_scp"."wb_material"."attribute_enable_flag" IS '属性启用标识';
COMMENT ON COLUMN "themetis_scp"."wb_material"."supply_action_type" IS '供应行为类型';
COMMENT ON COLUMN "themetis_scp"."wb_material"."production_supply_type" IS '工单供应类型';
COMMENT ON COLUMN "themetis_scp"."wb_material"."production_version_mode" IS '生产方案模式1.RATIO, 2.PRIORITY';
COMMENT ON COLUMN "themetis_scp"."wb_material"."production_consolidation_days" IS '生产固定供应天数';
COMMENT ON COLUMN "themetis_scp"."wb_material"."mix_substitution_mode" IS '1:全混替 2.单父项不可混替 3.单需求不可混替';
COMMENT ON COLUMN "themetis_scp"."wb_material"."use_up_flag" IS '替代料耗尽标识';
COMMENT ON COLUMN "themetis_scp"."wb_material"."demand_driven_type" IS '需求驱动方式';
COMMENT ON COLUMN "themetis_scp"."wb_material"."supply_priority_type" IS '供应优先级类型码';
COMMENT ON COLUMN "themetis_scp"."wb_material"."unit_cost" IS '单位成本';
COMMENT ON COLUMN "themetis_scp"."wb_material"."storage_cost" IS '存储成本';
COMMENT ON COLUMN "themetis_scp"."wb_material"."unit_late_cost" IS '单位延迟成本';
COMMENT ON COLUMN "themetis_scp"."wb_material"."unit_shortage_cost" IS '单位缺货成本';
COMMENT ON COLUMN "themetis_scp"."wb_material"."unit_early_cost" IS '单位提前成本';
COMMENT ON COLUMN "themetis_scp"."wb_material"."precision" IS '精度';
COMMENT ON COLUMN "themetis_scp"."wb_material"."sourcing_code" IS '来源模式1：生产；2：采购;  3: 分销';
COMMENT ON COLUMN "themetis_scp"."wb_material"."routing_enable_flag" IS '是否启用routing';
COMMENT ON COLUMN "themetis_scp"."wb_material"."planning_time_fence" IS '计划冻结期';
COMMENT ON COLUMN "themetis_scp"."wb_material"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_material"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_material"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_material"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_material"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_material" IS '物料主数据';

-- ----------------------------
-- Table structure for wb_mp_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_mp_bucket_data";
CREATE TABLE "themetis_scp"."wb_mp_bucket_data" (
  "tenant_id" int8 NOT NULL,
  "master_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."master_data_key" IS '主数据键值,用于与主数据关联';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."figure_type_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."wb_mp_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON TABLE "themetis_scp"."wb_mp_bucket_data" IS '主计划bucket数据，按内置主数据类型分表，提升性能';

-- ----------------------------
-- Table structure for wb_order_data_type_attribute
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_order_data_type_attribute";
CREATE TABLE "themetis_scp"."wb_order_data_type_attribute" (
  "tenant_id" int8 NOT NULL,
  "order_data_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "ref_order_data_type1" varchar(100) COLLATE "pg_catalog"."default",
  "ref_order_data_type2" varchar(100) COLLATE "pg_catalog"."default",
  "ref_order_data_type3" varchar(100) COLLATE "pg_catalog"."default",
  "ref_order_data_type4" varchar(100) COLLATE "pg_catalog"."default",
  "ref_order_data_type5" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attribute_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "data_column" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "key_attribute_flag" int2,
  "query_condition_flag" int2,
  "default_order_by_flag" int2,
  "data_source_url" varchar(1000) COLLATE "pg_catalog"."default",
  "prompt_up_flag" int2,
  "prompt_up_md_type" varchar(100) COLLATE "pg_catalog"."default",
  "prompt_up_parameter" varchar(500) COLLATE "pg_catalog"."default",
  "mouse_on_tips" varchar(100) COLLATE "pg_catalog"."default",
  "privilege_group_code" varchar(30) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."order_data_type_code" IS '单据数据代码，内置单据数据用表名，如wb_sales_order_data';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."ref_order_data_type1" IS '引用其他单据数据代码1';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."ref_order_data_type2" IS '引用其他单据数据代码2';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."ref_order_data_type3" IS '引用其他单据数据代码3';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."ref_order_data_type4" IS '引用其他单据数据代码4';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."ref_order_data_type5" IS '引用其他单据数据代码5';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."meta_attribute_code" IS '属性代码';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."data_column" IS 'wb_custom_order_data及默认单据数据表中对应的属性字段';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."key_attribute_flag" IS '是否主键字段，如果是主键字段，自动加入为order_data_key的一部分';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."query_condition_flag" IS '是否查询条件字段';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."default_order_by_flag" IS '默认排序字段';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."data_source_url" IS '数据来源服务url';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."prompt_up_flag" IS '字段值是否链接弹出窗口';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."prompt_up_md_type" IS '字段值弹出对应的主数据类型';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."prompt_up_parameter" IS '字段值弹出对应的参数取值，引用主数据的其他字段';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."mouse_on_tips" IS '鼠标悬停提示内容';
COMMENT ON COLUMN "themetis_scp"."wb_order_data_type_attribute"."privilege_group_code" IS '特殊权限控制组代码';
COMMENT ON TABLE "themetis_scp"."wb_order_data_type_attribute" IS '自定义单据数据属性关系';

-- ----------------------------
-- Table structure for wb_plan_bucket_type
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_plan_bucket_type";
CREATE TABLE "themetis_scp"."wb_plan_bucket_type" (
  "tenant_id" int8 NOT NULL,
  "bucket_type_code" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "bucket_by_day" int4,
  "bucket_by_week" int4,
  "week_start_day" varchar(30) COLLATE "pg_catalog"."default",
  "week_split_type" varchar(30) COLLATE "pg_catalog"."default",
  "bucket_by_month" int4,
  "bucket_by_quarter" int4,
  "bucket_by_year" int4,
  "sum_overlap_type" varchar(30) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."bucket_type_code" IS 'bucket类型码';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."bucket_by_day" IS '按天的bucket数';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."bucket_by_week" IS '按周的bucket数';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."week_start_day" IS '周的起始天，可选枚举值：Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."week_split_type" IS '周拆月的方式：可选枚举值：Whole_Week_By_Thursday,Whole_Week_By_Wednesday,Average_Quantity_By_Day';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."bucket_by_month" IS '按月的bucket数';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."bucket_by_quarter" IS '按季度的bucket数';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."bucket_by_year" IS '按年的bucket数';
COMMENT ON COLUMN "themetis_scp"."wb_plan_bucket_type"."sum_overlap_type" IS 'bucket重叠部分的处理类型：Early：重叠部分计入前一个类型的最后一个bucket；Late：重叠部分计入后一个类型的第一个bucket；Duplicate：各自汇总，数据可以重复';
COMMENT ON TABLE "themetis_scp"."wb_plan_bucket_type" IS '计划bucket类型定义，允许混合类型';

-- ----------------------------
-- Table structure for wb_planned_component_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planned_component_order_data";
CREATE TABLE "themetis_scp"."wb_planned_component_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "attribute_code" varchar(200) COLLATE "pg_catalog"."default",
  "planned_quantity" numeric(20,6),
  "material_production_rate" numeric(8,6),
  "original_material" varchar(30) COLLATE "pg_catalog"."default",
  "original_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "production_supply_type" varchar(30) COLLATE "pg_catalog"."default",
  "bom_component_no" varchar(100) COLLATE "pg_catalog"."default",
  "warehouse_no" varchar(30) COLLATE "pg_catalog"."default",
  "operation_seq_no" varchar(30) COLLATE "pg_catalog"."default",
  "material_supply_date" timestamp(6),
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."production_order_line_no" IS '生产工单行号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."material" IS '组件物料';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."attribute_code" IS '组件属性码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."planned_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."material_production_rate" IS '物料良率';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."original_material" IS '替代前原物料';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."original_material_revision" IS '原物料版本';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."production_supply_type" IS '生产供应类型';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."bom_component_no" IS 'BOM行号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."warehouse_no" IS '领料仓库号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."material_supply_date" IS '物料最晚供应时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."status" IS '状态：Draft,In Approval Process,Published,Released';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_component_order_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_planned_component_order_data" IS '计划工单物料单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_planned_operation_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planned_operation_order_data";
CREATE TABLE "themetis_scp"."wb_planned_operation_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "operation_seq_no" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "operation_start_date" timestamp(6),
  "operation_end_date" timestamp(6),
  "planned_quantity" numeric(20,6),
  "preparation_lead_time" numeric(20,6),
  "waiting_lead_time" numeric(20,6),
  "fix_lead_time" numeric(20,6),
  "unit_lead_time" numeric(20,6),
  "quantity_per_unit_time" int4,
  "fixed_lead_time" numeric(20,6),
  "actual_lead_time" numeric(20,6),
  "lead_time_uom" varchar(30) COLLATE "pg_catalog"."default",
  "transfer_batch" numeric(20,6),
  "operation_stetup_type" varchar(30) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."operation_start_date" IS '工序开工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."operation_end_date" IS '工序完工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."planned_quantity" IS '计划加工数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."preparation_lead_time" IS '工序前准备时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."waiting_lead_time" IS '等待加工周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."fix_lead_time" IS '固定加工周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."unit_lead_time" IS '单位加工周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."quantity_per_unit_time" IS '每单位时长生产数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."fixed_lead_time" IS '固定生产周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."actual_lead_time" IS '实际生产周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."lead_time_uom" IS '生产周期单位：Minute，Hour，Day';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."transfer_batch" IS '转移批量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."operation_stetup_type" IS '工序准备类型';
COMMENT ON COLUMN "themetis_scp"."wb_planned_operation_order_data"."status" IS '状态：Draft,In Approval Process,Published,Released';
COMMENT ON TABLE "themetis_scp"."wb_planned_operation_order_data" IS '计划工单工序单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_planned_product_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planned_product_order_data";
CREATE TABLE "themetis_scp"."wb_planned_product_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_product_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "product_material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "product_material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "planned_quantity" numeric(20,6),
  "planned_quantity_ratio" numeric(8,6),
  "main_product_flag" int2,
  "warehouse_no" varchar(30) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."production_order_product_no" IS '工单产出号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."product_material" IS '生产产成品';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."product_material_revision" IS '产成品物料版本';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."planned_quantity" IS '产出数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."planned_quantity_ratio" IS '产出数量比例';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."main_product_flag" IS '主产品标识';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."warehouse_no" IS '完工入库仓库号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_product_order_data"."status" IS '状态：Draft,In Approval Process,Published,Released';
COMMENT ON TABLE "themetis_scp"."wb_planned_product_order_data" IS '计划工单产出单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_planned_production_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planned_production_order_data";
CREATE TABLE "themetis_scp"."wb_planned_production_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "total_planned_quantity" numeric(20,6) NOT NULL,
  "mrp_planned_start_date" timestamp(6) NOT NULL,
  "mrp_planned_end_date" timestamp(6),
  "ctp_planned_start_date" timestamp(6),
  "ctp_planned_end_date" timestamp(6),
  "consolidation_days" int4,
  "mrp_consolidation_bucket_start_date" timestamp(6),
  "mrpconsolidation_bucket_end_date" timestamp(6),
  "ctp_consolidation_bucket_start_date" timestamp(6),
  "ctp_consolidation_bucket_end_date" timestamp(6),
  "material_production_version_no" varchar(100) COLLATE "pg_catalog"."default",
  "bom_code" varchar(100) COLLATE "pg_catalog"."default",
  "routing_code" varchar(100) COLLATE "pg_catalog"."default",
  "production_shift" varchar(30) COLLATE "pg_catalog"."default",
  "production_step_type" varchar(30) COLLATE "pg_catalog"."default",
  "production_rate" numeric(8,6),
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."total_planned_quantity" IS '总的数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."mrp_planned_start_date" IS '基于MRP计算的开工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."mrp_planned_end_date" IS '基于MRP计算的完工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."ctp_planned_start_date" IS '基于能力约束的开工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."ctp_planned_end_date" IS '基于能力约束的完工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."mrp_consolidation_bucket_start_date" IS '基于需求的固定天数合并时段起点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."mrpconsolidation_bucket_end_date" IS '基于需求的固定天数合并时段终点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."ctp_consolidation_bucket_start_date" IS '基于能力的固定天数合并时段起点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."ctp_consolidation_bucket_end_date" IS '基于能力的固定天数合并时段终点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."material_production_version_no" IS '生产版本号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."bom_code" IS 'BOM号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."routing_code" IS '工艺路径号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."production_shift" IS '生产班次';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."production_step_type" IS '生产准备类型';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."production_rate" IS '生产产出率';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."status" IS '状态：Draft,In Approval Process,Published,Released';
COMMENT ON COLUMN "themetis_scp"."wb_planned_production_order_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON TABLE "themetis_scp"."wb_planned_production_order_data" IS '计划工单单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_planned_purchase_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planned_purchase_order_data";
CREATE TABLE "themetis_scp"."wb_planned_purchase_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "planned_purchase_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "buyer_id" int4 NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "planned_quantity" numeric(20,6) NOT NULL,
  "mrp_request_date" timestamp(6) NOT NULL,
  "ctp_request_date" timestamp(6),
  "mrp_arrival_date" timestamp(6),
  "ctp_arrival_date" timestamp(6),
  "mrp_release_date" timestamp(6),
  "ctp_release_date" timestamp(6),
  "supply_category_id" varchar(100) COLLATE "pg_catalog"."default",
  "purchase_category_id" varchar(100) COLLATE "pg_catalog"."default",
  "lead_time" numeric(20,6),
  "consolidation_days" int4,
  "mrp_consolidation_bucket_start_date" timestamp(6),
  "mrp_consolidation_bucket_end_date" timestamp(6),
  "ctp_consolidation_bucket_start_date" timestamp(6),
  "ctp_consolidation_bucket_end_date" timestamp(6),
  "supplier_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_material" varchar(30) COLLATE "pg_catalog"."default",
  "demand_order_no" text COLLATE "pg_catalog"."default",
  "demand_order_line_no" text COLLATE "pg_catalog"."default",
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default",
  "production_order_line_no" varchar(50) COLLATE "pg_catalog"."default",
  "warehouse_no" varchar(30) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."planned_purchase_order_no" IS '计划订单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."buyer_id" IS '采购员用户ID';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."planned_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."mrp_request_date" IS '无约束分解的需求日期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."ctp_request_date" IS '约束齐套的需求时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."mrp_arrival_date" IS 'MRP分解的到货日期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."ctp_arrival_date" IS 'CTP齐套的到货日期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."mrp_release_date" IS 'MRP分解的下达日期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."ctp_release_date" IS 'CTP齐套的下达日期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."supply_category_id" IS '供应分类ID';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."purchase_category_id" IS '采购物品分类ID';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."lead_time" IS '货期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."mrp_consolidation_bucket_start_date" IS 'MRP固定供应起点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."mrp_consolidation_bucket_end_date" IS 'MRP固定供应终点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."ctp_consolidation_bucket_start_date" IS 'CTP固定供应起点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."ctp_consolidation_bucket_end_date" IS 'CTP固定供应终点';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."supplier_code" IS '供应商';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."product_material" IS '父项生产的物料';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."demand_order_no" IS '顶层需求单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."demand_order_line_no" IS '顶层需求行号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."production_order_no" IS '上层需求工单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."production_order_line_no" IS '上层需求工单行号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."warehouse_no" IS '到货入库仓库号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_purchase_order_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_planned_purchase_order_data" IS '采购计划单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_planned_resource_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planned_resource_order_data";
CREATE TABLE "themetis_scp"."wb_planned_resource_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "production_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "operation_seq_no" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "resource_start_date" timestamp(6),
  "resource_end_date" timestamp(6),
  "consumed_capacity" numeric(20,6),
  "capacity_uom" varchar(30) COLLATE "pg_catalog"."default",
  "operation_setup_type" varchar(30) COLLATE "pg_catalog"."default",
  "workshop_no" varchar(30) COLLATE "pg_catalog"."default",
  "resource_group" varchar(100) COLLATE "pg_catalog"."default",
  "resource_priority" int8,
  "consumption_quantity" int8,
  "preparation_lead_time" numeric(20,6),
  "waiting_lead_time" numeric(20,6),
  "fix_lead_time" numeric(20,6),
  "unit_lead_time" numeric(20,6),
  "lead_time_uom" varchar(30) COLLATE "pg_catalog"."default",
  "quantity_per_unit_time" int4,
  "calendar_no" varchar(100) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."production_order_no" IS '生产工单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."operation_seq_no" IS '工序号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."resource_no" IS '资源编号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."resource_start_date" IS '资源加工工序开工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."resource_end_date" IS '资源加工工序完工时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."consumed_capacity" IS '消耗资源产能';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."capacity_uom" IS '生产产能单位：Minute，Hour，Day，PCS';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."operation_setup_type" IS '工序准备类型';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."workshop_no" IS '资源所在车间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."resource_group" IS '资源组';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."resource_priority" IS '资源优先级';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."consumption_quantity" IS '针对Pooled资源的单位使用数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."preparation_lead_time" IS '工序前准备时间';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."waiting_lead_time" IS '等待加工周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."fix_lead_time" IS '固定加工周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."unit_lead_time" IS '单位加工周期';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."lead_time_uom" IS '生产周期单位：Minute，Hour，Day';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."quantity_per_unit_time" IS '每单位时长生产数量';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."calendar_no" IS '日历单号';
COMMENT ON COLUMN "themetis_scp"."wb_planned_resource_order_data"."status" IS '状态：Draft,In Approval Process,Published,Released';
COMMENT ON TABLE "themetis_scp"."wb_planned_resource_order_data" IS '计划工单资源消耗单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_planner
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planner";
CREATE TABLE "themetis_scp"."wb_planner" (
  "tenant_id" int8 NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "user_id" int4 NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planner"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_planner"."user_id" IS '用户ID';
COMMENT ON TABLE "themetis_scp"."wb_planner" IS '计划员';

-- ----------------------------
-- Table structure for wb_planner_workbench
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_planner_workbench";
CREATE TABLE "themetis_scp"."wb_planner_workbench" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_type" varchar(30) COLLATE "pg_catalog"."default",
  "workbench_name" varchar(100) COLLATE "pg_catalog"."default",
  "workbench_desc" varchar(400) COLLATE "pg_catalog"."default",
  "bucket_type_code" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "master_data_type" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_planner_workbench"."workbench_code" IS '代码';
COMMENT ON COLUMN "themetis_scp"."wb_planner_workbench"."workbench_type" IS '工作台类型，枚举值包括：time_bucket_based,order_based';
COMMENT ON COLUMN "themetis_scp"."wb_planner_workbench"."workbench_name" IS '名称';
COMMENT ON COLUMN "themetis_scp"."wb_planner_workbench"."workbench_desc" IS '描述';
COMMENT ON COLUMN "themetis_scp"."wb_planner_workbench"."bucket_type_code" IS 'bucket类型码';
COMMENT ON COLUMN "themetis_scp"."wb_planner_workbench"."master_data_type" IS '主数据类型：内置time_bucket_based:Demand_Plan,Sales_Operation_Plan,Master_Plan; order_based: Demand_Order,Supply_Order,Planned_Purchase_Order,Planned_Production_Order等';
COMMENT ON TABLE "themetis_scp"."wb_planner_workbench" IS '计划员工作台';

-- ----------------------------
-- Table structure for wb_product_attach_rate
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_product_attach_rate";
CREATE TABLE "themetis_scp"."wb_product_attach_rate" (
  "tenant_id" int8 NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "attach_rate" numeric(10,2),
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_product_attach_rate"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_product_attach_rate"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_product_attach_rate"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_product_attach_rate"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_product_attach_rate" IS '产品物料配比';

-- ----------------------------
-- Table structure for wb_product_category
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_product_category";
CREATE TABLE "themetis_scp"."wb_product_category" (
  "tenant_id" int8 NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_category_name" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_desc" varchar(400) COLLATE "pg_catalog"."default",
  "product_code" varchar(100) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_product_category"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_product_category"."planner_code" IS '计划员代码';
COMMENT ON TABLE "themetis_scp"."wb_product_category" IS '产品目录，即计划对象';

-- ----------------------------
-- Table structure for wb_product_hierarchy
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_product_hierarchy";
CREATE TABLE "themetis_scp"."wb_product_hierarchy" (
  "tenant_id" int8 NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "parent_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "root_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "category_level_num" int4 NOT NULL,
  "category_level_code" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_product_hierarchy"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."wb_product_hierarchy"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_product_hierarchy"."parent_category_code" IS '父产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_product_hierarchy"."root_category_code" IS '顶层产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_product_hierarchy"."category_level_num" IS '产品层次号，表示在产品树的第几层';
COMMENT ON COLUMN "themetis_scp"."wb_product_hierarchy"."category_level_code" IS '产品层次码，如1.1.2，表示在第三层的第二个';
COMMENT ON COLUMN "themetis_scp"."wb_product_hierarchy"."planner_code" IS '计划员代码';
COMMENT ON TABLE "themetis_scp"."wb_product_hierarchy" IS '产品结构树';

-- ----------------------------
-- Table structure for wb_sales_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_sales_order_data";
CREATE TABLE "themetis_scp"."wb_sales_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default",
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default",
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "schedule_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "required_quantity" numeric(20,6) NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "request_ship_date" timestamp(6) NOT NULL,
  "schedule_ship_date" timestamp(6),
  "schedule_ship_quantity" numeric(20,6),
  "original_request_ship_date" timestamp(6),
  "demand_shipment_code" varchar(50) COLLATE "pg_catalog"."default",
  "demand_priority" int8,
  "demand_level_no" varchar(100) COLLATE "pg_catalog"."default",
  "sales_order_category_id" varchar(100) COLLATE "pg_catalog"."default",
  "planned_fulfillment_date" timestamp(6),
  "planned_fulfillment_quantity" numeric(20,6) NOT NULL,
  "customer_no" varchar(100) COLLATE "pg_catalog"."default",
  "contract_no" varchar(100) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "order_setup_sype" varchar(30) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."order_no" IS '订单号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."order_line_no" IS '订单行号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."schedule_line_no" IS '发运行号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."required_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."material_revision" IS '需求版本';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."request_ship_date" IS '需求时间';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."schedule_ship_date" IS '发运时间';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."schedule_ship_quantity" IS '发运数量';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."original_request_ship_date" IS '原始需求时间';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."demand_shipment_code" IS '齐套号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."demand_priority" IS '需求优先级';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."demand_level_no" IS '需求层级号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."sales_order_category_id" IS '销售订单分类ID';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."planned_fulfillment_date" IS '计划满足时间';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."planned_fulfillment_quantity" IS '计划满足数量';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."customer_no" IS '客户号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."project_code" IS '项目号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."order_setup_sype" IS '订单生产的准备类型，不同的订单准备类型导致切换时间成本';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."supplier_no" IS '供应商号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_sales_order_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_sales_order_data" IS '订单需求单据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_so_fulfillment_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_so_fulfillment_order_data";
CREATE TABLE "themetis_scp"."wb_so_fulfillment_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "order_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "schedule_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "fulfillment_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "fulfillment_level_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "demand_date" timestamp(6) NOT NULL,
  "demand_quantity" numeric(20,6),
  "supply_date" timestamp(6),
  "supply_quantity" numeric(20,6) NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."order_no" IS '订单号';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."order_line_no" IS '订单行号';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."schedule_line_no" IS '发运行号';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."fulfillment_line_no" IS '履行计划行号，即展开后的展开行号';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."fulfillment_level_no" IS '展开层次号';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."material_revision" IS '需求版本';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."demand_date" IS '需求时间';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."demand_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."supply_date" IS '供应时间';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."supply_quantity" IS '供应数量';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."status" IS '状态：Fulfilled，Late，Short';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_so_fulfillment_order_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_so_fulfillment_order_data" IS '订单需求履行明细单据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_sop_bucket_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_sop_bucket_data";
CREATE TABLE "themetis_scp"."wb_sop_bucket_data" (
  "tenant_id" int8 NOT NULL,
  "master_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "plan_period_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "status" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "bk_qty_001" numeric(20,6),
  "bk_qty_002" numeric(20,6),
  "bk_qty_003" numeric(20,6),
  "bk_qty_004" numeric(20,6),
  "bk_qty_005" numeric(20,6),
  "bk_qty_006" numeric(20,6),
  "bk_qty_007" numeric(20,6),
  "bk_qty_008" numeric(20,6),
  "bk_qty_009" numeric(20,6),
  "bk_qty_010" numeric(20,6),
  "bk_qty_011" numeric(20,6),
  "bk_qty_012" numeric(20,6),
  "bk_qty_013" numeric(20,6),
  "bk_qty_014" numeric(20,6),
  "bk_qty_015" numeric(20,6),
  "bk_qty_016" numeric(20,6),
  "bk_qty_017" numeric(20,6),
  "bk_qty_018" numeric(20,6),
  "bk_qty_019" numeric(20,6),
  "bk_qty_020" numeric(20,6),
  "bk_qty_021" numeric(20,6),
  "bk_qty_022" numeric(20,6),
  "bk_qty_023" numeric(20,6),
  "bk_qty_024" numeric(20,6),
  "bk_qty_025" numeric(20,6),
  "bk_qty_026" numeric(20,6),
  "bk_qty_027" numeric(20,6),
  "bk_qty_028" numeric(20,6),
  "bk_qty_029" numeric(20,6),
  "bk_qty_030" numeric(20,6),
  "bk_qty_031" numeric(20,6),
  "bk_qty_032" numeric(20,6),
  "bk_qty_033" numeric(20,6),
  "bk_qty_034" numeric(20,6),
  "bk_qty_035" numeric(20,6),
  "bk_qty_036" numeric(20,6),
  "bk_qty_037" numeric(20,6),
  "bk_qty_038" numeric(20,6),
  "bk_qty_039" numeric(20,6),
  "bk_qty_040" numeric(20,6),
  "bk_qty_041" numeric(20,6),
  "bk_qty_042" numeric(20,6),
  "bk_qty_043" numeric(20,6),
  "bk_qty_044" numeric(20,6),
  "bk_qty_045" numeric(20,6),
  "bk_qty_046" numeric(20,6),
  "bk_qty_047" numeric(20,6),
  "bk_qty_048" numeric(20,6),
  "bk_qty_049" numeric(20,6),
  "bk_qty_050" numeric(20,6),
  "bk_qty_051" numeric(20,6),
  "bk_qty_052" numeric(20,6),
  "bk_qty_053" numeric(20,6),
  "bk_qty_054" numeric(20,6),
  "bk_qty_055" numeric(20,6),
  "bk_qty_056" numeric(20,6),
  "bk_qty_057" numeric(20,6),
  "bk_qty_058" numeric(20,6),
  "bk_qty_059" numeric(20,6),
  "bk_qty_060" numeric(20,6),
  "bk_qty_061" numeric(20,6),
  "bk_qty_062" numeric(20,6),
  "bk_qty_063" numeric(20,6),
  "bk_qty_064" numeric(20,6),
  "bk_qty_065" numeric(20,6),
  "bk_qty_066" numeric(20,6),
  "bk_qty_067" numeric(20,6),
  "bk_qty_068" numeric(20,6),
  "bk_qty_069" numeric(20,6),
  "bk_qty_070" numeric(20,6),
  "bk_qty_071" numeric(20,6),
  "bk_qty_072" numeric(20,6),
  "bk_qty_073" numeric(20,6),
  "bk_qty_074" numeric(20,6),
  "bk_qty_075" numeric(20,6),
  "bk_qty_076" numeric(20,6),
  "bk_qty_077" numeric(20,6),
  "bk_qty_078" numeric(20,6),
  "bk_qty_079" numeric(20,6),
  "bk_qty_080" numeric(20,6),
  "bk_qty_081" numeric(20,6),
  "bk_qty_082" numeric(20,6),
  "bk_qty_083" numeric(20,6),
  "bk_qty_084" numeric(20,6),
  "bk_qty_085" numeric(20,6),
  "bk_qty_086" numeric(20,6),
  "bk_qty_087" numeric(20,6),
  "bk_qty_088" numeric(20,6),
  "bk_qty_089" numeric(20,6),
  "bk_qty_090" numeric(20,6),
  "bk_qty_091" numeric(20,6),
  "bk_qty_092" numeric(20,6),
  "bk_qty_093" numeric(20,6),
  "bk_qty_094" numeric(20,6),
  "bk_qty_095" numeric(20,6),
  "bk_qty_096" numeric(20,6),
  "bk_qty_097" numeric(20,6),
  "bk_qty_098" numeric(20,6),
  "bk_qty_099" numeric(20,6),
  "bk_qty_100" numeric(20,6),
  "bk_qty_101" numeric(20,6),
  "bk_qty_102" numeric(20,6),
  "bk_qty_103" numeric(20,6),
  "bk_qty_104" numeric(20,6),
  "sum_qty_01" numeric(20,6),
  "sum_qty_02" numeric(20,6),
  "sum_qty_03" numeric(20,6),
  "sum_qty_04" numeric(20,6),
  "sum_qty_05" numeric(20,6),
  "sum_qty_06" numeric(20,6),
  "sum_qty_07" numeric(20,6),
  "sum_qty_08" numeric(20,6),
  "sum_qty_09" numeric(20,6),
  "sum_qty_10" numeric(20,6),
  "sum_qty_11" numeric(20,6),
  "sum_qty_12" numeric(20,6),
  "sum_qty_13" numeric(20,6),
  "sum_qty_14" numeric(20,6),
  "sum_qty_15" numeric(20,6),
  "sum_qty_16" numeric(20,6),
  "sum_qty_17" numeric(20,6),
  "sum_qty_18" numeric(20,6),
  "sum_qty_19" numeric(20,6),
  "sum_qty_20" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."master_data_key" IS '主数据键值,用于与主数据关联';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."plan_period_code" IS '期次代码';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."figure_type_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_001" IS 'bucket数量1';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_002" IS 'bucket数量2';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_003" IS 'bucket数量3';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_004" IS 'bucket数量4';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_005" IS 'bucket数量5';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_006" IS 'bucket数量6';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_007" IS 'bucket数量7';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_008" IS 'bucket数量8';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_009" IS 'bucket数量9';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_010" IS 'bucket数量10';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_011" IS 'bucket数量11';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_012" IS 'bucket数量12';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_013" IS 'bucket数量13';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_014" IS 'bucket数量14';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_015" IS 'bucket数量15';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_016" IS 'bucket数量16';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_017" IS 'bucket数量17';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_018" IS 'bucket数量18';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_019" IS 'bucket数量19';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_020" IS 'bucket数量20';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_021" IS 'bucket数量21';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_022" IS 'bucket数量22';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_023" IS 'bucket数量23';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_024" IS 'bucket数量24';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_025" IS 'bucket数量25';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_026" IS 'bucket数量26';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_027" IS 'bucket数量27';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_028" IS 'bucket数量28';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_029" IS 'bucket数量29';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_030" IS 'bucket数量30';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_031" IS 'bucket数量31';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_032" IS 'bucket数量32';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_033" IS 'bucket数量33';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_034" IS 'bucket数量34';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_035" IS 'bucket数量35';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_036" IS 'bucket数量36';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_037" IS 'bucket数量37';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_038" IS 'bucket数量38';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_039" IS 'bucket数量39';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_040" IS 'bucket数量40';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_041" IS 'bucket数量41';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_042" IS 'bucket数量42';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_043" IS 'bucket数量43';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_044" IS 'bucket数量44';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_045" IS 'bucket数量45';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_046" IS 'bucket数量46';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_047" IS 'bucket数量47';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_048" IS 'bucket数量48';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_049" IS 'bucket数量49';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_050" IS 'bucket数量50';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_051" IS 'bucket数量51';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_052" IS 'bucket数量52';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_053" IS 'bucket数量53';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_054" IS 'bucket数量54';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_055" IS 'bucket数量55';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_056" IS 'bucket数量56';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_057" IS 'bucket数量57';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_058" IS 'bucket数量58';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_059" IS 'bucket数量59';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_060" IS 'bucket数量60';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_061" IS 'bucket数量61';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_062" IS 'bucket数量62';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_063" IS 'bucket数量63';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_064" IS 'bucket数量64';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_065" IS 'bucket数量65';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_066" IS 'bucket数量66';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_067" IS 'bucket数量67';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_068" IS 'bucket数量68';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_069" IS 'bucket数量69';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_070" IS 'bucket数量70';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_071" IS 'bucket数量71';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_072" IS 'bucket数量72';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_073" IS 'bucket数量73';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_074" IS 'bucket数量74';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_075" IS 'bucket数量75';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_076" IS 'bucket数量76';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_077" IS 'bucket数量77';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_078" IS 'bucket数量78';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_079" IS 'bucket数量79';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_080" IS 'bucket数量80';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_081" IS 'bucket数量81';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_082" IS 'bucket数量82';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_083" IS 'bucket数量83';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_084" IS 'bucket数量84';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_085" IS 'bucket数量85';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_086" IS 'bucket数量86';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_087" IS 'bucket数量87';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_088" IS 'bucket数量88';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_089" IS 'bucket数量89';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_090" IS 'bucket数量90';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_091" IS 'bucket数量91';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_092" IS 'bucket数量92';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_093" IS 'bucket数量93';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_094" IS 'bucket数量94';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_095" IS 'bucket数量95';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_096" IS 'bucket数量96';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_097" IS 'bucket数量97';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_098" IS 'bucket数量98';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_099" IS 'bucket数量99';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_100" IS 'bucket数量100';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_101" IS 'bucket数量101';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_102" IS 'bucket数量102';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_103" IS 'bucket数量103';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."bk_qty_104" IS 'bucket数量104';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_01" IS '汇总数量1';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_02" IS '汇总数量2';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_03" IS '汇总数量3';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_04" IS '汇总数量4';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_05" IS '汇总数量5';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_06" IS '汇总数量6';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_07" IS '汇总数量7';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_08" IS '汇总数量8';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_09" IS '汇总数量9';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_10" IS '汇总数量10';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_11" IS '汇总数量11';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_12" IS '汇总数量12';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_13" IS '汇总数量13';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_14" IS '汇总数量14';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_15" IS '汇总数量15';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_16" IS '汇总数量16';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_17" IS '汇总数量17';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_18" IS '汇总数量18';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_19" IS '汇总数量19';
COMMENT ON COLUMN "themetis_scp"."wb_sop_bucket_data"."sum_qty_20" IS '汇总数量20';
COMMENT ON TABLE "themetis_scp"."wb_sop_bucket_data" IS 'S&OP计划bucket数据，按内置主数据类型分表，提升性能';

-- ----------------------------
-- Table structure for wb_sop_md_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_sop_md_data";
CREATE TABLE "themetis_scp"."wb_sop_md_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "demand_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "product_hierarchy_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "product_category_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default",
  "master_data_key" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."demand_network_code" IS '需求计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."demand_unit_code" IS '需求计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."product_hierarchy_code" IS '产品树编码';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."product_category_code" IS '产品编码';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."master_data_key" IS '主数据键值,用于与bucket数据关联';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_sop_md_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_sop_md_data" IS 'S&OP计划主数据，默认主数据类型';

-- ----------------------------
-- Table structure for wb_supply_network
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_supply_network";
CREATE TABLE "themetis_scp"."wb_supply_network" (
  "tenant_id" int8 NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_name" varchar(100) COLLATE "pg_catalog"."default",
  "supply_network_desc" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_supply_network"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "themetis_scp"."wb_supply_network"."supply_network_code" IS '供应网络代码';
COMMENT ON COLUMN "themetis_scp"."wb_supply_network"."supply_network_name" IS '供应网络名称';
COMMENT ON COLUMN "themetis_scp"."wb_supply_network"."supply_network_desc" IS '供应网络描述';
COMMENT ON TABLE "themetis_scp"."wb_supply_network" IS '供应网络头';

-- ----------------------------
-- Table structure for wb_supply_order_data
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_supply_order_data";
CREATE TABLE "themetis_scp"."wb_supply_order_data" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar(100) COLLATE "pg_catalog"."default",
  "buyer_id" int4 NOT NULL,
  "supply_order_no" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_order_line_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_order_shipment_no" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "order_data_key" varchar(300) COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar(30) COLLATE "pg_catalog"."default",
  "supply_quantity" numeric(20,6),
  "supply_date" timestamp(6),
  "supply_priority" int8,
  "supply_category_id" varchar(100) COLLATE "pg_catalog"."default",
  "purchase_category_id" varchar(100) COLLATE "pg_catalog"."default",
  "effective_start_date" timestamp(6),
  "effective_end_date" timestamp(6),
  "warehouse_no" varchar(30) COLLATE "pg_catalog"."default",
  "project_code" varchar(100) COLLATE "pg_catalog"."default",
  "order_no" varchar(100) COLLATE "pg_catalog"."default",
  "supplier_no" varchar(100) COLLATE "pg_catalog"."default",
  "exception_type" varchar(40) COLLATE "pg_catalog"."default",
  "suggested_arrival_date" timestamp(6),
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "product_code" varchar(50) COLLATE "pg_catalog"."default",
  "phase_no" varchar(20) COLLATE "pg_catalog"."default",
  "drawing_code" varchar(50) COLLATE "pg_catalog"."default",
  "product_flag" varchar(20) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_network_code" IS '供应计划网络';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."buyer_id" IS '采购员用户ID';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_order_no" IS '供应单号';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_order_line_no" IS '供应单行号';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_order_shipment_no" IS '供应单发运行号';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."order_data_key" IS '单据数据键值，允许加入其他字段作为键值';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_quantity" IS '供应数量';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_date" IS '供应时间';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_priority" IS '供应优先级';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supply_category_id" IS '供应分类ID';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."purchase_category_id" IS '采购物品分类ID';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."effective_start_date" IS '供应生效时间';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."effective_end_date" IS '供应失效时间';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."warehouse_no" IS '到货入库仓库号';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."project_code" IS '项目号，针对按项目计划场景';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."order_no" IS '订单号，针对按订单计划场景';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."supplier_no" IS '供应商号，针对分供应商计划场景';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."exception_type" IS '例外信息建议类型：EXPEDITE,DE-EXPEDITE,CANCEL';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."suggested_arrival_date" IS '例外信息建议供应时间';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."product_code" IS '产品代号';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."phase_no" IS '阶段标记';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."drawing_code" IS '图代号';
COMMENT ON COLUMN "themetis_scp"."wb_supply_order_data"."product_flag" IS '版本标记';
COMMENT ON TABLE "themetis_scp"."wb_supply_order_data" IS '供应单据数据，默认单据类型数据';

-- ----------------------------
-- Table structure for wb_supply_unit
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_supply_unit";
CREATE TABLE "themetis_scp"."wb_supply_unit" (
  "tenant_id" int8 NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_name" varchar(100) COLLATE "pg_catalog"."default",
  "supply_unit_desc" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_supply_unit"."supply_network_code" IS '供应网络代码';
COMMENT ON COLUMN "themetis_scp"."wb_supply_unit"."supply_unit_code" IS '供应单元代码';
COMMENT ON COLUMN "themetis_scp"."wb_supply_unit"."supply_unit_name" IS '供应单元名称';
COMMENT ON COLUMN "themetis_scp"."wb_supply_unit"."supply_unit_desc" IS '供应单元描述';
COMMENT ON TABLE "themetis_scp"."wb_supply_unit" IS '供应单元';

-- ----------------------------
-- Table structure for wb_unit_supply_path
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_unit_supply_path";
CREATE TABLE "themetis_scp"."wb_unit_supply_path" (
  "tenant_id" int8 NOT NULL,
  "supply_network_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "supply_path_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "to_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "from_unit_code" varchar(40) COLLATE "pg_catalog"."default" NOT NULL,
  "distribution_priority" int8,
  "distribution_ratio" numeric(8,6),
  "distribution_type" varchar(50) COLLATE "pg_catalog"."default",
  "distribution_lead_time" numeric(20,6),
  "min_lot_size" numeric(20,6),
  "max_lot_size" numeric(20,6),
  "lot_size_multiple" numeric(20,6),
  "consolidation_days" int4,
  "lateness_tolerance" int4,
  "effective_start_date" timestamp(6),
  "effective_end_date" timestamp(6),
  "unit_distribution_cost" numeric(20,6),
  "fix_distribution_cost" numeric(20,6),
  "meta_attr01" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr02" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr03" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr04" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr05" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr06" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr07" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr08" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr09" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr10" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr11" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr12" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr13" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr14" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr15" varchar(100) COLLATE "pg_catalog"."default",
  "meta_attr16" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr17" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr18" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr19" varchar(400) COLLATE "pg_catalog"."default",
  "meta_attr20" varchar(1000) COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric(20,6),
  "meta_attr27" numeric(20,6),
  "meta_attr28" numeric(20,6),
  "meta_attr29" numeric(20,6),
  "meta_attr30" numeric(20,6),
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."supply_network_code" IS '供应网络代码';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."supply_path_code" IS '供应路径代码';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."to_unit_code" IS '需求方计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."from_unit_code" IS '供应方计划单元';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."distribution_priority" IS '优先级';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."distribution_ratio" IS '分销比例';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."distribution_type" IS '分销类型';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."distribution_lead_time" IS '分销周期';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."min_lot_size" IS '最小批量';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."max_lot_size" IS '最大批量';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."lot_size_multiple" IS '批量倍数';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."consolidation_days" IS '固定供应天数';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."lateness_tolerance" IS '容忍度';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."effective_start_date" IS '生效时间';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."effective_end_date" IS '失效时间';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."unit_distribution_cost" IS '单位转运成本';
COMMENT ON COLUMN "themetis_scp"."wb_unit_supply_path"."fix_distribution_cost" IS '固定转运成本';
COMMENT ON TABLE "themetis_scp"."wb_unit_supply_path" IS '供应单元供应路径';

-- ----------------------------
-- Table structure for wb_workbench_figure_type
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."wb_workbench_figure_type";
CREATE TABLE "themetis_scp"."wb_workbench_figure_type" (
  "tenant_id" int8 NOT NULL,
  "workbench_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "figure_type_code" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "editable_flag" int2 NOT NULL,
  "plan_result_flag" int2 NOT NULL,
  "negative_red_flag" int2 NOT NULL,
  "privilege_group_code" varchar(30) COLLATE "pg_catalog"."default",
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4
)
;
COMMENT ON COLUMN "themetis_scp"."wb_workbench_figure_type"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."wb_workbench_figure_type"."figure_type_code" IS '数据维度码';
COMMENT ON COLUMN "themetis_scp"."wb_workbench_figure_type"."editable_flag" IS '是否可修改';
COMMENT ON COLUMN "themetis_scp"."wb_workbench_figure_type"."plan_result_flag" IS '是否为计划发布结果，同一个工作台原则上只有一个数据维度可发布，审批流程实例ID只与该维度相关，其他维度无效';
COMMENT ON COLUMN "themetis_scp"."wb_workbench_figure_type"."negative_red_flag" IS '是否负数显示为红色';
COMMENT ON COLUMN "themetis_scp"."wb_workbench_figure_type"."privilege_group_code" IS '特殊权限控制组代码';
COMMENT ON TABLE "themetis_scp"."wb_workbench_figure_type" IS '计划员工作台';

-- ----------------------------
-- Table structure for scp_planned_purchase_order
-- ----------------------------
DROP TABLE IF EXISTS "themetis_scp"."scp_planned_purchase_order";
CREATE TABLE "themetis_scp"."scp_planned_purchase_order" (
  "id" int8 NOT NULL DEFAULT nextval('"themetis_scp".scp_planned_purchase_order_id_seq'::regclass),
  "workbench_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "supply_unit_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_type_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planning_period_code" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "material_revision" varchar COLLATE "pg_catalog"."default",
  "attribute_code" varchar COLLATE "pg_catalog"."default",
  "planned_purchase_order_no" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planned_quantity" numeric NOT NULL,
  "mrp_request_date" timestamp(6) NOT NULL,
  "ctp_request_date" timestamp(6),
  "mrp_arrival_date" timestamp(6),
  "ctp_arrival_date" timestamp(6),
  "mrp_release_date" timestamp(6),
  "ctp_release_date" timestamp(6),
  "mrp_consolidation_bucket_start_date" timestamp(6),
  "mrp_consolidation_bucket_end_date" timestamp(6),
  "ctp_consolidation_bucket_start_date" timestamp(6),
  "ctp_consolidation_bucket_end_date" timestamp(6),
  "product_material" varchar COLLATE "pg_catalog"."default",
  "demand_order_no" text COLLATE "pg_catalog"."default",
  "demand_order_line_no" text COLLATE "pg_catalog"."default",
  "production_order_no" text COLLATE "pg_catalog"."default",
  "production_order_line_no" text COLLATE "pg_catalog"."default",
  "warehouse_no" varchar COLLATE "pg_catalog"."default",
  "customer_no" varchar COLLATE "pg_catalog"."default",
  "contract_no" varchar COLLATE "pg_catalog"."default",
  "project_code" varchar COLLATE "pg_catalog"."default",
  "supplier_no" varchar COLLATE "pg_catalog"."default",
  "status" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "approval_instance_id" int4,
  "remarks" varchar(500) COLLATE "pg_catalog"."default",
  "data_source_type" varchar COLLATE "pg_catalog"."default" NOT NULL,
  "planner_code" varchar COLLATE "pg_catalog"."default",
  "erp_pr_no" varchar COLLATE "pg_catalog"."default",
  "erp_pr_header_id" varchar COLLATE "pg_catalog"."default",
  "erp_pr_line_id" varchar COLLATE "pg_catalog"."default",
  "erp_pr_status" varchar COLLATE "pg_catalog"."default",
  "meta_attr01" varchar COLLATE "pg_catalog"."default",
  "meta_attr02" varchar COLLATE "pg_catalog"."default",
  "meta_attr03" varchar COLLATE "pg_catalog"."default",
  "meta_attr04" varchar COLLATE "pg_catalog"."default",
  "meta_attr05" varchar COLLATE "pg_catalog"."default",
  "meta_attr06" varchar COLLATE "pg_catalog"."default",
  "meta_attr07" varchar COLLATE "pg_catalog"."default",
  "meta_attr08" varchar COLLATE "pg_catalog"."default",
  "meta_attr09" varchar COLLATE "pg_catalog"."default",
  "meta_attr10" varchar COLLATE "pg_catalog"."default",
  "meta_attr11" varchar COLLATE "pg_catalog"."default",
  "meta_attr12" varchar COLLATE "pg_catalog"."default",
  "meta_attr13" varchar COLLATE "pg_catalog"."default",
  "meta_attr14" varchar COLLATE "pg_catalog"."default",
  "meta_attr15" varchar COLLATE "pg_catalog"."default",
  "meta_attr16" varchar COLLATE "pg_catalog"."default",
  "meta_attr17" varchar COLLATE "pg_catalog"."default",
  "meta_attr18" varchar COLLATE "pg_catalog"."default",
  "meta_attr19" varchar COLLATE "pg_catalog"."default",
  "meta_attr20" varchar COLLATE "pg_catalog"."default",
  "meta_attr21" timestamp(6),
  "meta_attr22" timestamp(6),
  "meta_attr23" timestamp(6),
  "meta_attr24" timestamp(6),
  "meta_attr25" timestamp(6),
  "meta_attr26" numeric,
  "meta_attr27" numeric,
  "meta_attr28" numeric,
  "meta_attr29" numeric,
  "meta_attr30" numeric,
  "creation_date" timestamp(6),
  "last_update_date" timestamp(6),
  "created_by" int4,
  "last_updated_by" int4,
  "tenant_id" int8 NOT NULL DEFAULT '-1'::integer,
  "risk_level" varchar(100) COLLATE "pg_catalog"."default",
  "production_material_request_date" timestamp(6),
  "production_delivery_method" varchar(20) COLLATE "pg_catalog"."default",
  "meta_attr31" timestamp(6),
  "meta_attr32" timestamp(6),
  "meta_attr33" timestamp(6),
  "meta_attr34" timestamp(6),
  "meta_attr35" timestamp(6),
  "meta_attr36" numeric(20,6),
  "meta_attr37" numeric(20,6),
  "meta_attr38" numeric(20,6),
  "meta_attr39" numeric(20,6),
  "meta_attr40" numeric(20,6),
  "submitter_id" int4,
  "approver_id" varchar(500) COLLATE "pg_catalog"."default",
  "interface_status" varchar COLLATE "pg_catalog"."default",
  "lock_version" int2 NOT NULL DEFAULT 0,
  "supply_center_code" varchar(20) COLLATE "pg_catalog"."default",
  "purchase_requisition_type" varchar(50) COLLATE "pg_catalog"."default" DEFAULT '1'::character varying
)
PARTITION BY  (
)
;
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."workbench_code" IS '工作台代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."supply_unit_code" IS '供应计划单元';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."planning_period_type_code" IS '期次类型码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."planning_period_code" IS '期次码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."material" IS '物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."material_revision" IS '物料版本';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."planned_purchase_order_no" IS '计划订单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."planned_quantity" IS '需求数量';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."mrp_request_date" IS '无约束分解的需求日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."ctp_request_date" IS '约束齐套的需求时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."mrp_arrival_date" IS 'MRP分解的到货日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."ctp_arrival_date" IS 'CTP齐套的到货日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."mrp_release_date" IS 'MRP分解的下达日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."ctp_release_date" IS 'CTP齐套的下达日期';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."mrp_consolidation_bucket_start_date" IS 'MRP固定供应起点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."mrp_consolidation_bucket_end_date" IS 'MRP固定供应终点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."ctp_consolidation_bucket_start_date" IS 'CTP固定供应起点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."ctp_consolidation_bucket_end_date" IS 'CTP固定供应终点';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."product_material" IS '父项生产的物料';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."demand_order_no" IS '顶层需求单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."demand_order_line_no" IS '顶层需求行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."production_order_no" IS '上层需求工单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."production_order_line_no" IS '上层需求工单行号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."warehouse_no" IS '到货入库仓库号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."customer_no" IS '客户代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."contract_no" IS '合同号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."project_code" IS '项目编码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."supplier_no" IS '供应商';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."status" IS '状态：Draft,In Approval Process,Published';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."approval_instance_id" IS '审批流程实例ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."data_source_type" IS '数据来源类型   ENGINE/MANUAL';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."planner_code" IS '计划员代码';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."erp_pr_no" IS 'erp pr 单号';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."erp_pr_header_id" IS 'erp pr header id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."erp_pr_line_id" IS 'erp pr line id';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."erp_pr_status" IS 'erp pr 状态';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."risk_level" IS '欠料风险等级';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."production_material_request_date" IS '物料齐套需求时间';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."production_delivery_method" IS '生产交付模式：ETO,MTO,MTS';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."submitter_id" IS '提交人ID';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."approver_id" IS '审批人账号ID(当前审批人)';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."interface_status" IS '接口状态，0失败 1成功';
COMMENT ON COLUMN "themetis_scp"."scp_planned_purchase_order"."purchase_requisition_type" IS 'pr类型，枚举值：1：生产需求，2：售后需求，3：试产需求，4：研发需求，默认1';

-- ----------------------------
-- Indexes structure for table hx_scp_bom_lock
-- ----------------------------
CREATE INDEX "hx_scp_bom_lock_idx1" ON "themetis_scp"."hx_scp_bom_lock" USING btree (
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "channel" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table hx_scp_bom_lock
-- ----------------------------
ALTER TABLE "themetis_scp"."hx_scp_bom_lock" ADD CONSTRAINT "hx_scp_bom_lock_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table hx_scp_box_transfer_quantity
-- ----------------------------
CREATE INDEX "hx_scp_box_transfer_quantity_idx1" ON "themetis_scp"."hx_scp_box_transfer_quantity" USING btree (
  "box_body" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "door_body" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "required_month" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table hx_scp_box_transfer_quantity
-- ----------------------------
ALTER TABLE "themetis_scp"."hx_scp_box_transfer_quantity" ADD CONSTRAINT "scp_box_transfer_quantity_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table hx_scp_ord_deliv_result
-- ----------------------------
CREATE INDEX "hx_scp_ord_deliv_result_idx" ON "themetis_scp"."hx_scp_ord_deliv_result" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table hx_scp_ord_deliv_result
-- ----------------------------
ALTER TABLE "themetis_scp"."hx_scp_ord_deliv_result" ADD CONSTRAINT "hx_scp_ord_deliv_result_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_approval_flow_instance_node
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_approval_flow_instance_node" ADD CONSTRAINT "scp_approval_flow_instance_node_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_approval_log
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_approval_log" ADD CONSTRAINT "scp_approval_log_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_atp_bucket_data
-- ----------------------------
CREATE INDEX "scp_atp_bucket_data_idx1" ON "themetis_scp"."scp_atp_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_atp_bucket_data_idx2" ON "themetis_scp"."scp_atp_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_atp_bucket_data_idx3" ON "themetis_scp"."scp_atp_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "creation_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_atp_bucket_data_uidx" ON "themetis_scp"."scp_atp_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_atp_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_atp_bucket_data" ADD CONSTRAINT "scp_atp_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_atp_planning_item
-- ----------------------------
CREATE INDEX "scp_atp_planning_item_idx1" ON "themetis_scp"."scp_atp_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_atp_planning_item_idx2" ON "themetis_scp"."scp_atp_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_atp_planning_item_idx3" ON "themetis_scp"."scp_atp_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_atp_planning_item_uidx" ON "themetis_scp"."scp_atp_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_atp_planning_item_uidx_n" ON "themetis_scp"."scp_atp_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_atp_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_atp_planning_item" ADD CONSTRAINT "scp_atp_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_attachment_list
-- ----------------------------
CREATE INDEX "scp_attachment_list_idx" ON "themetis_scp"."scp_attachment_list" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "attachment_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "created_by" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "creation_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_attachment_list
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_attachment_list" ADD CONSTRAINT "scp_attachment_list_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_capacity_allocation_bucket_data
-- ----------------------------
CREATE INDEX "scp_capacity_allocation_bucket_data_idx01" ON "themetis_scp"."scp_capacity_allocation_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_capacity_allocation_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_capacity_allocation_bucket_data" ADD CONSTRAINT "scp_capacity_allocation_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_capacity_bucket_data
-- ----------------------------
CREATE INDEX "scp_capacity_bucket_data_idx01" ON "themetis_scp"."scp_capacity_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_capacity_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_capacity_bucket_data" ADD CONSTRAINT "scp_capacity_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_capacity_planning_item
-- ----------------------------
CREATE UNIQUE INDEX "scp_capacity_planning_item_idx" ON "themetis_scp"."scp_capacity_planning_item" USING btree (
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_capacity_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_capacity_planning_item" ADD CONSTRAINT "scp_capacity_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_custom_bucket_data
-- ----------------------------
CREATE INDEX "scp_custom_bucket_data_idx01" ON "themetis_scp"."scp_custom_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_custom_bucket_data_idx1" ON "themetis_scp"."scp_custom_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_custom_bucket_data_idx2" ON "themetis_scp"."scp_custom_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_custom_bucket_data_uidx" ON "themetis_scp"."scp_custom_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_custom_bucket_data_uidx_n" ON "themetis_scp"."scp_custom_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_custom_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_custom_bucket_data" ADD CONSTRAINT "scp_custom_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_custom_md_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_custom_md_data" ADD CONSTRAINT "wb_custom_md_data_pkey" PRIMARY KEY ("tenant_id", "master_data_type_code", "master_data_key");

-- ----------------------------
-- Indexes structure for table scp_custom_planning_item
-- ----------------------------
CREATE INDEX "scp_custom_planning_item_idx1" ON "themetis_scp"."scp_custom_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_custom_planning_item_idx2" ON "themetis_scp"."scp_custom_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_custom_planning_item_idx3" ON "themetis_scp"."scp_custom_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_custom_planning_item_uidx" ON "themetis_scp"."scp_custom_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_custom_planning_item_uidx_n" ON "themetis_scp"."scp_custom_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_period_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_period_type_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_custom_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_custom_planning_item" ADD CONSTRAINT "scp_custom_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_custom_planning_item_copy1
-- ----------------------------
CREATE INDEX "scp_custom_planning_item_idx1_copy1" ON "themetis_scp"."scp_custom_planning_item_copy1" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_custom_planning_item_idx2_copy1" ON "themetis_scp"."scp_custom_planning_item_copy1" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_custom_planning_item_idx3_copy1" ON "themetis_scp"."scp_custom_planning_item_copy1" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_custom_planning_item_uidx_copy1" ON "themetis_scp"."scp_custom_planning_item_copy1" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_custom_planning_item_uidx_n_copy1" ON "themetis_scp"."scp_custom_planning_item_copy1" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_period_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_period_type_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_custom_planning_item_copy1
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_custom_planning_item_copy1" ADD CONSTRAINT "scp_custom_planning_item_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_distribution_order_exception
-- ----------------------------
CREATE INDEX "scp_distribution_order_exception_idx1" ON "themetis_scp"."scp_distribution_order_exception" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_distribution_order_exception_idx2" ON "themetis_scp"."scp_distribution_order_exception" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_distribution_order_exception_idx3" ON "themetis_scp"."scp_distribution_order_exception" USING btree (
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_distribution_order_exception_uidx" ON "themetis_scp"."scp_distribution_order_exception" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "distribution_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "distribution_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_distribution_order_exception
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_distribution_order_exception" ADD CONSTRAINT "scp_distribution_order_exception_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_dp_bucket_data
-- ----------------------------
CREATE INDEX "scp_dp_bucket_data_idx01" ON "themetis_scp"."scp_dp_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_dp_bucket_data_idx1" ON "themetis_scp"."scp_dp_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_dp_bucket_data_idx2" ON "themetis_scp"."scp_dp_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_dp_bucket_data_uidx" ON "themetis_scp"."scp_dp_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_dp_bucket_data_uidx_n" ON "themetis_scp"."scp_dp_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_dp_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_dp_bucket_data" ADD CONSTRAINT "scp_dp_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_dp_planning_item
-- ----------------------------
CREATE INDEX "scp_dp_planning_item_idx1" ON "themetis_scp"."scp_dp_planning_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_dp_planning_item_idx2" ON "themetis_scp"."scp_dp_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_dp_planning_item_idx3" ON "themetis_scp"."scp_dp_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_dp_planning_item_uidx" ON "themetis_scp"."scp_dp_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_dp_planning_item_uidx_n" ON "themetis_scp"."scp_dp_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_dp_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_dp_planning_item" ADD CONSTRAINT "scp_dp_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_dp_waterfall_data
-- ----------------------------
CREATE INDEX "scp_dp_waterfall_data_idx1" ON "themetis_scp"."scp_dp_waterfall_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_dp_waterfall_data_idx2" ON "themetis_scp"."scp_dp_waterfall_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_dp_waterfall_data_uidx" ON "themetis_scp"."scp_dp_waterfall_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_dp_waterfall_data_uidx_n" ON "themetis_scp"."scp_dp_waterfall_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_dp_waterfall_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_dp_waterfall_data" ADD CONSTRAINT "scp_dp_waterfall_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_fcst_bucket_data
-- ----------------------------
CREATE INDEX "scp_fcst_bucket_data_idx01" ON "themetis_scp"."scp_fcst_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_fcst_bucket_data_idx1" ON "themetis_scp"."scp_fcst_bucket_data" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_fcst_bucket_data_idx2" ON "themetis_scp"."scp_fcst_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_fcst_bucket_data_uidx" ON "themetis_scp"."scp_fcst_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_fcst_bucket_data_uidx_n" ON "themetis_scp"."scp_fcst_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_fcst_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_fcst_bucket_data" ADD CONSTRAINT "scp_fcst_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_fcst_planning_item
-- ----------------------------
CREATE INDEX "scp_fcst_planning_item_idx1" ON "themetis_scp"."scp_fcst_planning_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_fcst_planning_item_idx2" ON "themetis_scp"."scp_fcst_planning_item" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_fcst_planning_item_idx3" ON "themetis_scp"."scp_fcst_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_fcst_planning_item_uidx" ON "themetis_scp"."scp_fcst_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_fcst_planning_item_uidx_n" ON "themetis_scp"."scp_fcst_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_fcst_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_fcst_planning_item" ADD CONSTRAINT "scp_fcst_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_ind_bucket_data
-- ----------------------------
CREATE INDEX "scp_ind_bucket_data_idx01" ON "themetis_scp"."scp_ind_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ind_bucket_data_idx1" ON "themetis_scp"."scp_ind_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ind_bucket_data_idx2" ON "themetis_scp"."scp_ind_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ind_bucket_data_uidx" ON "themetis_scp"."scp_ind_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ind_bucket_data_uidx_n" ON "themetis_scp"."scp_ind_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_ind_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_ind_bucket_data" ADD CONSTRAINT "scp_ind_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_ind_planning_item
-- ----------------------------
CREATE INDEX "scp_ind_planning_item_idx1" ON "themetis_scp"."scp_ind_planning_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ind_planning_item_idx2" ON "themetis_scp"."scp_ind_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ind_planning_item_idx3" ON "themetis_scp"."scp_ind_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ind_planning_item_uidx" ON "themetis_scp"."scp_ind_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ind_planning_item_uidx_n" ON "themetis_scp"."scp_ind_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_ind_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_ind_planning_item" ADD CONSTRAINT "scp_ind_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_ind_waterfall_data
-- ----------------------------
CREATE INDEX "scp_ind_waterfall_data_idx1" ON "themetis_scp"."scp_ind_waterfall_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ind_waterfall_data_idx2" ON "themetis_scp"."scp_ind_waterfall_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ind_waterfall_data_uidx" ON "themetis_scp"."scp_ind_waterfall_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ind_waterfall_data_uidx_n" ON "themetis_scp"."scp_ind_waterfall_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_ind_waterfall_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_ind_waterfall_data" ADD CONSTRAINT "scp_ind_waterfall_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_inventory_anlysis_bucket_data
-- ----------------------------
CREATE INDEX "scp_inventory_anlysis_bucket_data_idx01" ON "themetis_scp"."scp_inventory_anlysis_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_inventory_anlysis_bucket_data_idx1" ON "themetis_scp"."scp_inventory_anlysis_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_inventory_anlysis_bucket_data_idx2" ON "themetis_scp"."scp_inventory_anlysis_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_inventory_anlysis_bucket_data_uidx" ON "themetis_scp"."scp_inventory_anlysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_inventory_anlysis_bucket_data_uidx_n" ON "themetis_scp"."scp_inventory_anlysis_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_group_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_inventory_anlysis_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_inventory_anlysis_bucket_data" ADD CONSTRAINT "scp_inventory_anlysis_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_inventory_anlysis_planning_item
-- ----------------------------
CREATE INDEX "scp_inventory_anlysis_planning_item_idx1" ON "themetis_scp"."scp_inventory_anlysis_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_inventory_anlysis_planning_item_idx2" ON "themetis_scp"."scp_inventory_anlysis_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_inventory_anlysis_planning_item_uidx" ON "themetis_scp"."scp_inventory_anlysis_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_group_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_inventory_anlysis_planning_item_uidx_n" ON "themetis_scp"."scp_inventory_anlysis_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_group_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_inventory_anlysis_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_inventory_anlysis_planning_item" ADD CONSTRAINT "scp_inventory_anlysis_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_jit_bucket_data
-- ----------------------------
CREATE INDEX "scp_jit_bucket_data_idx01" ON "themetis_scp"."scp_jit_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_jit_bucket_data_idx1" ON "themetis_scp"."scp_jit_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_jit_bucket_data_idx2" ON "themetis_scp"."scp_jit_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_jit_bucket_data_uidx" ON "themetis_scp"."scp_jit_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "parent_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_group_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "location_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_jit_bucket_data_uidx_n" ON "themetis_scp"."scp_jit_bucket_data" USING btree (
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(location_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_group_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(parent_material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_jit_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_jit_bucket_data" ADD CONSTRAINT "scp_jit_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_jit_planning_item
-- ----------------------------
CREATE INDEX "scp_jit_planning_item_idx1" ON "themetis_scp"."scp_jit_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_jit_planning_item_idx2" ON "themetis_scp"."scp_jit_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_group_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_jit_planning_item_uidx" ON "themetis_scp"."scp_jit_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "parent_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_group_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "location_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_jit_planning_item_uidx_n" ON "themetis_scp"."scp_jit_planning_item" USING btree (
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(location_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_group_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(parent_material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_jit_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_jit_planning_item" ADD CONSTRAINT "scp_jit_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_material_allocation_bucket_data
-- ----------------------------
CREATE INDEX "scp_material_allocation_bucket_data_idx01" ON "themetis_scp"."scp_material_allocation_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_material_allocation_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_allocation_bucket_data" ADD CONSTRAINT "scp_material_allocation_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_material_allocation_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_allocation_planning_item" ADD CONSTRAINT "scp_material_allocation_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_material_demand_bucket_data
-- ----------------------------
CREATE INDEX "scp_material_demand_bucket_data_idx01" ON "themetis_scp"."scp_material_demand_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_material_demand_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_demand_bucket_data" ADD CONSTRAINT "scp_material_demand_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_material_demand_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_demand_planning_item" ADD CONSTRAINT "scp_material_demand_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_material_mold_demand_bucket_data
-- ----------------------------
CREATE INDEX "scp_material_mold_demand_bucket_data_idx01" ON "themetis_scp"."scp_material_mold_demand_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_material_mold_demand_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_mold_demand_bucket_data" ADD CONSTRAINT "scp_material_mold_demand_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_material_mold_demand_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_mold_demand_planning_item" ADD CONSTRAINT "scp_material_mold_demand_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_material_mold_supply_bucket_data
-- ----------------------------
CREATE INDEX "scp_material_mold_supply_bucket_data_idx01" ON "themetis_scp"."scp_material_mold_supply_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_material_mold_supply_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_mold_supply_bucket_data" ADD CONSTRAINT "scp_material_mold_supply_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_material_mold_supply_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_mold_supply_planning_item" ADD CONSTRAINT "scp_material_mold_supply_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_material_planning_attribute
-- ----------------------------
CREATE INDEX "scp_material_planning_attribute_idx" ON "themetis_scp"."scp_material_planning_attribute" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_material_planning_attribute
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_material_planning_attribute" ADD CONSTRAINT "scp_material_planning_attribute_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mds_analysis_bucket_data
-- ----------------------------
CREATE INDEX "scp_mds_analysis_bucket_data_idx01" ON "themetis_scp"."scp_mds_analysis_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_analysis_bucket_data_idx1" ON "themetis_scp"."scp_mds_analysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_analysis_bucket_data_idx2" ON "themetis_scp"."scp_mds_analysis_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_analysis_bucket_data_idx3" ON "themetis_scp"."scp_mds_analysis_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_analysis_bucket_data_uidx" ON "themetis_scp"."scp_mds_analysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_analysis_bucket_data_uidx_n" ON "themetis_scp"."scp_mds_analysis_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mds_analysis_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mds_analysis_bucket_data" ADD CONSTRAINT "scp_mds_analysis_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mds_analysis_planning_item
-- ----------------------------
CREATE INDEX "scp_mds_analysis_planning_item_idx1" ON "themetis_scp"."scp_mds_analysis_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_analysis_planning_item_idx2" ON "themetis_scp"."scp_mds_analysis_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_analysis_planning_item_idx3" ON "themetis_scp"."scp_mds_analysis_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_analysis_planning_item_uidx" ON "themetis_scp"."scp_mds_analysis_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_analysis_planning_item_uidx_n" ON "themetis_scp"."scp_mds_analysis_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mds_analysis_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mds_analysis_planning_item" ADD CONSTRAINT "scp_mds_analysis_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mds_bucket_data
-- ----------------------------
CREATE INDEX "scp_mds_bucket_data_idx01" ON "themetis_scp"."scp_mds_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_bucket_data_idx1" ON "themetis_scp"."scp_mds_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_bucket_data_idx2" ON "themetis_scp"."scp_mds_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_bucket_data_idx3" ON "themetis_scp"."scp_mds_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_bucket_data_uidx" ON "themetis_scp"."scp_mds_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_bucket_data_uidx_n" ON "themetis_scp"."scp_mds_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mds_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mds_bucket_data" ADD CONSTRAINT "scp_mds_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mds_planning_item
-- ----------------------------
CREATE INDEX "scp_mds_planning_item_idx1" ON "themetis_scp"."scp_mds_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_planning_item_idx2" ON "themetis_scp"."scp_mds_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_planning_item_idx3" ON "themetis_scp"."scp_mds_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_planning_item_uidx" ON "themetis_scp"."scp_mds_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_planning_item_uidx_n" ON "themetis_scp"."scp_mds_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mds_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mds_planning_item" ADD CONSTRAINT "scp_mds_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mds_sim_priority
-- ----------------------------
CREATE INDEX "scp_mds_sim_priority_IDX1" ON "themetis_scp"."scp_mds_sim_priority" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "request_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_sim_priority_IDX2" ON "themetis_scp"."scp_mds_sim_priority" USING btree (
  "demand_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "request_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_sim_priority_UIDX" ON "themetis_scp"."scp_mds_sim_priority" USING btree (
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mds_sim_priority
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mds_sim_priority" ADD CONSTRAINT "in_demand_plan_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mds_waterfall_data
-- ----------------------------
CREATE INDEX "scp_mds_waterfall_data_idx1" ON "themetis_scp"."scp_mds_waterfall_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_waterfall_data_idx2" ON "themetis_scp"."scp_mds_waterfall_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mds_waterfall_data_idx3" ON "themetis_scp"."scp_mds_waterfall_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_waterfall_data_uidx" ON "themetis_scp"."scp_mds_waterfall_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mds_waterfall_data_uidx_n" ON "themetis_scp"."scp_mds_waterfall_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mds_waterfall_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mds_waterfall_data" ADD CONSTRAINT "scp_mds_waterfall_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mfd_bucket_data
-- ----------------------------
CREATE INDEX "scp_mfd_bucket_data_idx01" ON "themetis_scp"."scp_mfd_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfd_bucket_data_idx1" ON "themetis_scp"."scp_mfd_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfd_bucket_data_idx2" ON "themetis_scp"."scp_mfd_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfd_bucket_data_idx3" ON "themetis_scp"."scp_mfd_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "creation_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mfd_bucket_data_uidx" ON "themetis_scp"."scp_mfd_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mfd_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mfd_bucket_data" ADD CONSTRAINT "scp_mfd_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mfd_planning_item
-- ----------------------------
CREATE INDEX "scp_mfd_planning_item_idx1" ON "themetis_scp"."scp_mfd_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfd_planning_item_idx2" ON "themetis_scp"."scp_mfd_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfd_planning_item_idx3" ON "themetis_scp"."scp_mfd_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mfd_planning_item_uidx" ON "themetis_scp"."scp_mfd_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mfd_planning_item_uidx_n" ON "themetis_scp"."scp_mfd_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mfd_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mfd_planning_item" ADD CONSTRAINT "scp_mfd_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mfp_bucket_data
-- ----------------------------
CREATE INDEX "scp_mfp_bucket_data_idx01" ON "themetis_scp"."scp_mfp_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfp_bucket_data_idx1" ON "themetis_scp"."scp_mfp_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfp_bucket_data_idx2" ON "themetis_scp"."scp_mfp_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfp_bucket_data_idx3" ON "themetis_scp"."scp_mfp_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "creation_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mfp_bucket_data_uidx" ON "themetis_scp"."scp_mfp_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mfp_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mfp_bucket_data" ADD CONSTRAINT "scp_mfp_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mfp_planning_item
-- ----------------------------
CREATE INDEX "scp_mfp_planning_item_idx1" ON "themetis_scp"."scp_mfp_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfp_planning_item_idx2" ON "themetis_scp"."scp_mfp_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mfp_planning_item_idx3" ON "themetis_scp"."scp_mfp_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mfp_planning_item_uidx" ON "themetis_scp"."scp_mfp_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mfp_planning_item_uidx_n" ON "themetis_scp"."scp_mfp_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mfp_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mfp_planning_item" ADD CONSTRAINT "scp_mfp_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mps_analysis_bucket_data
-- ----------------------------
CREATE INDEX "scp_mps_analysis_bucket_data_idx01" ON "themetis_scp"."scp_mps_analysis_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_analysis_bucket_data_idx1" ON "themetis_scp"."scp_mps_analysis_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_analysis_bucket_data_idx2" ON "themetis_scp"."scp_mps_analysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_analysis_bucket_data_idx3" ON "themetis_scp"."scp_mps_analysis_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "creation_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_analysis_bucket_data_uidx" ON "themetis_scp"."scp_mps_analysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mps_analysis_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mps_analysis_bucket_data" ADD CONSTRAINT "scp_mps_analysis_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mps_analysis_planning_item
-- ----------------------------
CREATE INDEX "scp_mps_analysis_planning_item_idx1" ON "themetis_scp"."scp_mps_analysis_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_analysis_planning_item_idx2" ON "themetis_scp"."scp_mps_analysis_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_analysis_planning_item_idx3" ON "themetis_scp"."scp_mps_analysis_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_analysis_planning_item_uidx" ON "themetis_scp"."scp_mps_analysis_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_analysis_planning_item_uidx_n" ON "themetis_scp"."scp_mps_analysis_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mps_analysis_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mps_analysis_planning_item" ADD CONSTRAINT "scp_mps_analysis_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mps_bucket_data
-- ----------------------------
CREATE INDEX "scp_mps_bucket_data_idx01" ON "themetis_scp"."scp_mps_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_bucket_data_idx1" ON "themetis_scp"."scp_mps_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_bucket_data_idx2" ON "themetis_scp"."scp_mps_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_bucket_data_uidx" ON "themetis_scp"."scp_mps_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_bucket_data_uidx_n" ON "themetis_scp"."scp_mps_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mps_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mps_bucket_data" ADD CONSTRAINT "scp_mps_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mps_planning_item
-- ----------------------------
CREATE INDEX "scp_mps_planning_item_idx1" ON "themetis_scp"."scp_mps_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_planning_item_idx2" ON "themetis_scp"."scp_mps_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_planning_item_idx3" ON "themetis_scp"."scp_mps_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_planning_item_uidx" ON "themetis_scp"."scp_mps_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_planning_item_uidx_n" ON "themetis_scp"."scp_mps_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mps_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mps_planning_item" ADD CONSTRAINT "scp_mps_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mps_waterfall_data
-- ----------------------------
CREATE INDEX "scp_mps_waterfall_data_idx1" ON "themetis_scp"."scp_mps_waterfall_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mps_waterfall_data_idx2" ON "themetis_scp"."scp_mps_waterfall_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_waterfall_data_uidx" ON "themetis_scp"."scp_mps_waterfall_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mps_waterfall_data_uidx_n" ON "themetis_scp"."scp_mps_waterfall_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mps_waterfall_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mps_waterfall_data" ADD CONSTRAINT "scp_mps_waterfall_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mrp_bucket_data
-- ----------------------------
CREATE INDEX "scp_mrp_bucket_data_idx01" ON "themetis_scp"."scp_mrp_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mrp_bucket_data_idx1" ON "themetis_scp"."scp_mrp_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mrp_bucket_data_idx2" ON "themetis_scp"."scp_mrp_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mrp_bucket_data_uidx" ON "themetis_scp"."scp_mrp_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mrp_bucket_data_uidx_n" ON "themetis_scp"."scp_mrp_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mrp_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mrp_bucket_data" ADD CONSTRAINT "scp_mrp_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_mrp_planning_item
-- ----------------------------
CREATE INDEX "scp_mrp_planning_item_idx1" ON "themetis_scp"."scp_mrp_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mrp_planning_item_idx2" ON "themetis_scp"."scp_mrp_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_mrp_planning_item_idx3" ON "themetis_scp"."scp_mrp_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mrp_planning_item_uidx" ON "themetis_scp"."scp_mrp_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_mrp_planning_item_uidx_n" ON "themetis_scp"."scp_mrp_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_mrp_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_mrp_planning_item" ADD CONSTRAINT "scp_mrp_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_demand_fulfillment
-- ----------------------------
CREATE INDEX "scp_planned_demand_fulfillment_idx1" ON "themetis_scp"."scp_planned_demand_fulfillment" USING btree (
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_demand_fulfillment_idx2" ON "themetis_scp"."scp_planned_demand_fulfillment" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_demand_fulfillment_idx3" ON "themetis_scp"."scp_planned_demand_fulfillment" USING btree (
  "production_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_demand_fulfillment_uidx" ON "themetis_scp"."scp_planned_demand_fulfillment" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_plan_line_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "production_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_order_plan_line_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_demand_fulfillment
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_demand_fulfillment" ADD CONSTRAINT "scp_planned_demand_fulfillment_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_demand_fulfillment_unit
-- ----------------------------
CREATE INDEX "scp_planned_demand_fulfillment_unit_idx1" ON "themetis_scp"."scp_planned_demand_fulfillment_unit" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_plan_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_demand_fulfillment_unit_idx2" ON "themetis_scp"."scp_planned_demand_fulfillment_unit" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "fulfillment_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_demand_fulfillment_unit_uidx1" ON "themetis_scp"."scp_planned_demand_fulfillment_unit" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_plan_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_plan_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_demand_fulfillment_unit
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_demand_fulfillment_unit" ADD CONSTRAINT "scp_planned_demand_fulfillment_unit_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_demand_order
-- ----------------------------
CREATE INDEX "scp_planned_demand_order_idx1" ON "themetis_scp"."scp_planned_demand_order" USING btree (
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_demand_order_uidx" ON "themetis_scp"."scp_planned_demand_order" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_plan_line_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_demand_order_uidx_n" ON "themetis_scp"."scp_planned_demand_order" USING btree (
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_line_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_plan_line_id, '-999'::bigint) "pg_catalog"."int8_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_demand_order
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_demand_order" ADD CONSTRAINT "scp_planned_demand_order_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_distribution_order
-- ----------------------------
CREATE INDEX "scp_planned_distribution_order_idx1" ON "themetis_scp"."scp_planned_distribution_order" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_distribution_order_idx2" ON "themetis_scp"."scp_planned_distribution_order" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_distribution_order_idx3" ON "themetis_scp"."scp_planned_distribution_order" USING btree (
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_distribution_order_uidx" ON "themetis_scp"."scp_planned_distribution_order" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "distribution_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_distribution_order_uidx_n" ON "themetis_scp"."scp_planned_distribution_order" USING btree (
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(distribution_order_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_distribution_order
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_distribution_order" ADD CONSTRAINT "scp_planned_distribution_order_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_production_order
-- ----------------------------
CREATE INDEX "idx_period_code" ON "themetis_scp"."scp_planned_production_order" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_production_order
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_production_order" ADD CONSTRAINT "scp_planned_production_order_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_production_order_component
-- ----------------------------
CREATE INDEX "scp_planned_production_order_component_idx1" ON "themetis_scp"."scp_planned_production_order_component" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_production_order_component_idx2" ON "themetis_scp"."scp_planned_production_order_component" USING btree (
  "production_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_production_order_component
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_production_order_component" ADD CONSTRAINT "scp_planned_production_order_component_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_planned_production_order_operation
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_production_order_operation" ADD CONSTRAINT "scp_planned_production_order_operation_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_planned_production_order_outsource
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_production_order_outsource" ADD CONSTRAINT "scp_planned_production_order_operation_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_production_order_product
-- ----------------------------
CREATE INDEX "scp_planned_production_order_product_idx1" ON "themetis_scp"."scp_planned_production_order_product" USING btree (
  "product_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_production_order_product_idx2" ON "themetis_scp"."scp_planned_production_order_product" USING btree (
  "production_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_production_order_product
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_production_order_product" ADD CONSTRAINT "scp_planned_production_order_product_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_planned_production_order_report
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_production_order_report" ADD CONSTRAINT "scp_planned_production_order_report_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_production_order_resource
-- ----------------------------
CREATE INDEX "scp_planned_production_order_resource_idx1" ON "themetis_scp"."scp_planned_production_order_resource" USING btree (
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_production_order_resource
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_production_order_resource" ADD CONSTRAINT "scp_planned_production_order_resource_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_planned_purchase_order_bak_20250521
-- ----------------------------
CREATE INDEX "scp_planned_purchase_order_idx3" ON "themetis_scp"."scp_planned_purchase_order_bak_20250521" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "product_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_purchase_order_idx4" ON "themetis_scp"."scp_planned_purchase_order_bak_20250521" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Indexes structure for table scp_planned_purchase_order_null
-- ----------------------------
CREATE INDEX "scp_planned_purchase_order_nu_planning_period_code_tenant__idx1" ON "themetis_scp"."scp_planned_purchase_order_null" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "mrp_release_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "mrp_request_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_purchase_order_nu_planning_period_code_tenant__idx2" ON "themetis_scp"."scp_planned_purchase_order_null" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "last_update_date" "pg_catalog"."timestamp_ops" DESC NULLS FIRST,
  "id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_purchase_order_nu_planning_period_code_tenant_i_idx" ON "themetis_scp"."scp_planned_purchase_order_null" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "last_update_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_purchase_order_nu_planning_period_code_workben_idx1" ON "themetis_scp"."scp_planned_purchase_order_null" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_purchase_order_nu_planning_period_code_workben_idx2" ON "themetis_scp"."scp_planned_purchase_order_null" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_purchase_order_nu_planning_period_code_workbenc_idx" ON "themetis_scp"."scp_planned_purchase_order_null" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "status" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_purchase_order_null
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_purchase_order_null" ADD CONSTRAINT "scp_planned_purchase_order_null_pkey" PRIMARY KEY ("id", "planning_period_code");

-- ----------------------------
-- Indexes structure for table scp_planned_purchase_order_sr
-- ----------------------------
CREATE INDEX "scp_planned_purchase_order_sr_idx1" ON "themetis_scp"."scp_planned_purchase_order_sr" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "supplier_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_purchase_order_sr_uidx" ON "themetis_scp"."scp_planned_purchase_order_sr" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_purchase_order_sr_uidx_n" ON "themetis_scp"."scp_planned_purchase_order_sr" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_purchase_order_sr
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_purchase_order_sr" ADD CONSTRAINT "pe_planned_purchase_order_sr_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_planning_simulation_scenario
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planning_simulation_scenario" ADD CONSTRAINT "scp_planning_simulation_scenario_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_production_order_exception
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_production_order_exception" ADD CONSTRAINT "scp_production_order_exception_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_purchase_forecast_bucket_data
-- ----------------------------
CREATE INDEX "scp_purchase_forecast_bucket_data_idx01" ON "themetis_scp"."scp_purchase_forecast_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_forecast_bucket_data_idx1" ON "themetis_scp"."scp_purchase_forecast_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_forecast_bucket_data_idx2" ON "themetis_scp"."scp_purchase_forecast_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_forecast_bucket_data_uidx" ON "themetis_scp"."scp_purchase_forecast_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_forecast_bucket_data_uidx_n" ON "themetis_scp"."scp_purchase_forecast_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_purchase_forecast_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_purchase_forecast_bucket_data" ADD CONSTRAINT "scp_purchase_forecast_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_purchase_forecast_item
-- ----------------------------
CREATE INDEX "scp_purchase_forecast_item_idx1" ON "themetis_scp"."scp_purchase_forecast_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_forecast_item_idx2" ON "themetis_scp"."scp_purchase_forecast_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_forecast_item_idx3" ON "themetis_scp"."scp_purchase_forecast_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_forecast_item_uidx" ON "themetis_scp"."scp_purchase_forecast_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_forecast_item_uidx_n" ON "themetis_scp"."scp_purchase_forecast_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "vendor_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_purchase_forecast_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_purchase_forecast_item" ADD CONSTRAINT "scp_purchase_forecast_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_purchase_order_exception
-- ----------------------------
CREATE INDEX "scp_purchase_order_exception_idx1" ON "themetis_scp"."scp_purchase_order_exception" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_order_exception_idx2" ON "themetis_scp"."scp_purchase_order_exception" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_order_exception_uidx" ON "themetis_scp"."scp_purchase_order_exception" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "purchase_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "shipment_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_order_exception_uidx_n" ON "themetis_scp"."scp_purchase_order_exception" USING btree (
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(shipment_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "purchase_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_purchase_order_exception
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_purchase_order_exception" ADD CONSTRAINT "scp_purchase_order_exception_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_purchase_planning_analysis_bucket_data
-- ----------------------------
CREATE INDEX "scp_purchase_planning_analysis_bucket_data_idx01" ON "themetis_scp"."scp_purchase_planning_analysis_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_planning_analysis_bucket_data_idx1" ON "themetis_scp"."scp_purchase_planning_analysis_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_planning_analysis_bucket_data_idx2" ON "themetis_scp"."scp_purchase_planning_analysis_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_planning_analysis_bucket_data_uidx" ON "themetis_scp"."scp_purchase_planning_analysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_planning_analysis_bucket_data_uidx_n" ON "themetis_scp"."scp_purchase_planning_analysis_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_purchase_planning_analysis_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_purchase_planning_analysis_bucket_data" ADD CONSTRAINT "scp_purchase_planning_analysis_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_purchase_planning_analysis_item
-- ----------------------------
CREATE INDEX "scp_purchase_planning_analysis_item_idx1" ON "themetis_scp"."scp_purchase_planning_analysis_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_planning_analysis_item_idx2" ON "themetis_scp"."scp_purchase_planning_analysis_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_purchase_planning_analysis_item_idx3" ON "themetis_scp"."scp_purchase_planning_analysis_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_planning_analysis_item_uidx" ON "themetis_scp"."scp_purchase_planning_analysis_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_planning_analysis_item_uidx_n" ON "themetis_scp"."scp_purchase_planning_analysis_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_purchase_planning_analysis_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_purchase_planning_analysis_item" ADD CONSTRAINT "scp_purchase_planning_analysis_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_purchase_planning_item
-- ----------------------------
CREATE UNIQUE INDEX "scp_purchase_planning_item_uidx" ON "themetis_scp"."scp_purchase_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_purchase_planning_item_uidx_n" ON "themetis_scp"."scp_purchase_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_purchase_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_purchase_planning_item" ADD CONSTRAINT "scp_purchase_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_raw_pegging_bucket_data
-- ----------------------------
CREATE INDEX "scp_raw_pegging_bucket_data_idx01" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_bucket_data_idx1" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_bucket_data_idx2" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_bucket_data_idx3" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_bucket_data_idx4" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_bucket_data_idx5" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_bucket_data_idx6" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_raw_pegging_bucket_data_uidx" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_raw_pegging_bucket_data_uidx_n" ON "themetis_scp"."scp_raw_pegging_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_line_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_raw_pegging_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_raw_pegging_bucket_data" ADD CONSTRAINT "scp_raw_pegging_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_raw_pegging_planning_item
-- ----------------------------
CREATE INDEX "scp_raw_pegging_planning_item_idx1" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_planning_item_idx2" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_planning_item_idx3" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_planning_item_idx4" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_planning_item_idx5" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_raw_pegging_planning_item_idx6" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_raw_pegging_planning_item_uidx" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_raw_pegging_planning_item_uidx_n" ON "themetis_scp"."scp_raw_pegging_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_line_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_order_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_raw_pegging_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_raw_pegging_planning_item" ADD CONSTRAINT "scp_raw_pegging_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_resource_anlysis_bucket_data
-- ----------------------------
CREATE INDEX "scp_resource_anlysis_bucket_data_idx01" ON "themetis_scp"."scp_resource_anlysis_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_anlysis_bucket_data_idx1" ON "themetis_scp"."scp_resource_anlysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_anlysis_bucket_data_idx2" ON "themetis_scp"."scp_resource_anlysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_anlysis_bucket_data_idx3" ON "themetis_scp"."scp_resource_anlysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_resource_anlysis_bucket_data_uidx" ON "themetis_scp"."scp_resource_anlysis_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "constraint_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_resource_anlysis_bucket_data_uidx_n" ON "themetis_scp"."scp_resource_anlysis_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(constraint_type, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_group, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_resource_anlysis_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_resource_anlysis_bucket_data" ADD CONSTRAINT "scp_resource_anlysis_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_resource_anlysis_planning_item
-- ----------------------------
CREATE UNIQUE INDEX "scp_resource_anlysis_planning_item_uidx" ON "themetis_scp"."scp_resource_anlysis_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "constraint_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_resource_anlysis_planning_item_uidx_n" ON "themetis_scp"."scp_resource_anlysis_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(constraint_type, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_group, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_resource_anlysis_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_resource_anlysis_planning_item" ADD CONSTRAINT "scp_resource_anlysis_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_resource_bucket_data
-- ----------------------------
CREATE INDEX "scp_resource_bucket_data_idx01" ON "themetis_scp"."scp_resource_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_bucket_data_idx1" ON "themetis_scp"."scp_resource_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_bucket_data_idx2" ON "themetis_scp"."scp_resource_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_bucket_data_idx3" ON "themetis_scp"."scp_resource_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_bucket_data_idx4" ON "themetis_scp"."scp_resource_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_resource_bucket_data_uidx" ON "themetis_scp"."scp_resource_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "constraint_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_resource_bucket_data_uidx_n" ON "themetis_scp"."scp_resource_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(constraint_type, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_group, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_resource_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_resource_bucket_data" ADD CONSTRAINT "scp_resource_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_resource_planning_attribute
-- ----------------------------
CREATE INDEX "scp_resource_planning_attribute_idx" ON "themetis_scp"."scp_resource_planning_attribute" USING btree (
  "id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_resource_planning_attribute
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_resource_planning_attribute" ADD CONSTRAINT "scp_resource_planning_attribute_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_resource_planning_item
-- ----------------------------
CREATE UNIQUE INDEX "scp_resource_planning_item_uidx" ON "themetis_scp"."scp_resource_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "constraint_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_resource_planning_item_uidx_n" ON "themetis_scp"."scp_resource_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(constraint_type, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_group, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(resource_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_resource_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_resource_planning_item" ADD CONSTRAINT "scp_resource_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_resource_shortage_bucket_data
-- ----------------------------
CREATE INDEX "scp_resource_shortage_bucket_data_idx" ON "themetis_scp"."scp_resource_shortage_bucket_data" USING btree (
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "bucket_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_resource_shortage_bucket_data_idx01" ON "themetis_scp"."scp_resource_shortage_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_resource_shortage_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_resource_shortage_bucket_data" ADD CONSTRAINT "scp_resource_shortage_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_resource_shortage_planning_item
-- ----------------------------
CREATE INDEX "scp_resource_shortage_planning_item_idx" ON "themetis_scp"."scp_resource_shortage_planning_item" USING btree (
  "resource_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_resource_shortage_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_resource_shortage_planning_item" ADD CONSTRAINT "scp_resource_shortage_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_shortage_bucket_data
-- ----------------------------
CREATE INDEX "scp_shortage_bucket_data_idx01" ON "themetis_scp"."scp_shortage_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_shortage_bucket_data_idx1" ON "themetis_scp"."scp_shortage_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_shortage_bucket_data_idx2" ON "themetis_scp"."scp_shortage_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_shortage_bucket_data_uidx" ON "themetis_scp"."scp_shortage_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_shortage_bucket_data_uidx_n" ON "themetis_scp"."scp_shortage_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_group_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_shortage_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_shortage_bucket_data" ADD CONSTRAINT "scp_shortage_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_shortage_planning_item
-- ----------------------------
CREATE INDEX "scp_shortage_planning_item_idx1" ON "themetis_scp"."scp_shortage_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_shortage_planning_item_idx2" ON "themetis_scp"."scp_shortage_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_shortage_planning_item_idx3" ON "themetis_scp"."scp_shortage_planning_item" USING btree (
  "material_group_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "risk_horizon_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_shortage_planning_item_uidx" ON "themetis_scp"."scp_shortage_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_group_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_shortage_planning_item_uidx_n" ON "themetis_scp"."scp_shortage_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_group_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_shortage_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_shortage_planning_item" ADD CONSTRAINT "scp_shortage_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sim_demand_comparation
-- ----------------------------
CREATE INDEX "scp_sim_demand_comparation_idx1" ON "themetis_scp"."scp_sim_demand_comparation" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "sim_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sim_demand_comparation_idx2" ON "themetis_scp"."scp_sim_demand_comparation" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "sim_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sim_demand_comparation_idx3" ON "themetis_scp"."scp_sim_demand_comparation" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "sim_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "add_lateness_days" "pg_catalog"."int4_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sim_demand_comparation
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_demand_comparation" ADD CONSTRAINT "scp_sim_demand_comparation_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sim_demand_order
-- ----------------------------
CREATE INDEX "scp_sim_demand_order_idx1" ON "themetis_scp"."scp_sim_demand_order" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sim_demand_order_idx2" ON "themetis_scp"."scp_sim_demand_order" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sim_demand_order
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_demand_order" ADD CONSTRAINT "scp_sim_demand_order_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sim_demand_order_period
-- ----------------------------
CREATE INDEX "scp_sim_demand_order_period_idx1" ON "themetis_scp"."scp_sim_demand_order_period" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "sim_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sim_demand_order_period_idx2" ON "themetis_scp"."scp_sim_demand_order_period" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "sim_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_order_material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sim_demand_order_period
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_demand_order_period" ADD CONSTRAINT "scp_sim_demand_order_period_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_sim_planning_available_inventory
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_planning_available_inventory" ADD CONSTRAINT "scp_sim_planning_available_inventory_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_sim_planning_demand_plan
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_planning_demand_plan" ADD CONSTRAINT "scp_sim_planning_demand_plan_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_sim_planning_purchase_order
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_planning_purchase_order" ADD CONSTRAINT "scp_sim_planning_purchase_order_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_sim_planning_resource_capacity
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_planning_resource_capacity" ADD CONSTRAINT "scp_sim_planning_resource_capacity_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_sim_planning_sales_order
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_planning_sales_order" ADD CONSTRAINT "scp_sim_planning_sales_order_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sim_scenario_period
-- ----------------------------
CREATE UNIQUE INDEX "scp_sim_scenario_period_idx" ON "themetis_scp"."scp_sim_scenario_period" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "sim_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sim_scenario_period
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sim_scenario_period" ADD CONSTRAINT "scp_sim_scenario_period_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_simulation_scenario
-- ----------------------------
CREATE UNIQUE INDEX "scp_simulation_scenario_idx" ON "themetis_scp"."scp_simulation_scenario" USING btree (
  "sim_scenario_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_simulation_scenario
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_simulation_scenario" ADD CONSTRAINT "scp_simulation_scenario_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sop_bucket_data
-- ----------------------------
CREATE INDEX "scp_sop_bucket_data_idx01" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_bucket_data_idx1" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_bucket_data_idx2" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_bucket_data_uidx" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_bucket_data_uidx_n" ON "themetis_scp"."scp_sop_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sop_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sop_bucket_data" ADD CONSTRAINT "scp_sop_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sop_planning_item
-- ----------------------------
CREATE INDEX "scp_sop_planning_item_idx1" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_planning_item_idx2" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_planning_item_idx3" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_planning_item_uidx" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_planning_item_uidx_n" ON "themetis_scp"."scp_sop_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sop_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sop_planning_item" ADD CONSTRAINT "scp_sop_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sop_waterfall_bucket_data
-- ----------------------------
CREATE INDEX "scp_sop_waterfall_bucket_data_idx01" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_waterfall_bucket_data_idx1" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_waterfall_bucket_data_idx2" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_waterfall_bucket_data_uidx" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_waterfall_bucket_data_uidx_n" ON "themetis_scp"."scp_sop_waterfall_bucket_data" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sop_waterfall_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sop_waterfall_bucket_data" ADD CONSTRAINT "scp_sop_waterfall_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_sop_waterfall_planning_item
-- ----------------------------
CREATE INDEX "scp_sop_waterfall_planning_item_idx1" ON "themetis_scp"."scp_sop_waterfall_planning_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_waterfall_planning_item_idx2" ON "themetis_scp"."scp_sop_waterfall_planning_item" USING btree (
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_sop_waterfall_planning_item_idx3" ON "themetis_scp"."scp_sop_waterfall_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_waterfall_planning_item_uidx" ON "themetis_scp"."scp_sop_waterfall_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_sop_waterfall_planning_item_uidx_n" ON "themetis_scp"."scp_sop_waterfall_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(planning_item_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supply_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_center_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "aggregated_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_sop_waterfall_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_sop_waterfall_planning_item" ADD CONSTRAINT "scp_sop_waterfall_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_ss_bucket_data
-- ----------------------------
CREATE INDEX "scp_ss_bucket_data_idx01" ON "themetis_scp"."scp_ss_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ss_bucket_data_idx1" ON "themetis_scp"."scp_ss_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ss_bucket_data_idx2" ON "themetis_scp"."scp_ss_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ss_bucket_data_idx3" ON "themetis_scp"."scp_ss_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "creation_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ss_bucket_data_uidx" ON "themetis_scp"."scp_ss_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_ss_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_ss_bucket_data" ADD CONSTRAINT "scp_ss_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_ss_planning_item
-- ----------------------------
CREATE INDEX "scp_ss_planning_item_idx1" ON "themetis_scp"."scp_ss_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ss_planning_item_idx2" ON "themetis_scp"."scp_ss_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_ss_planning_item_idx3" ON "themetis_scp"."scp_ss_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ss_planning_item_uidx" ON "themetis_scp"."scp_ss_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_ss_planning_item_uidx_n" ON "themetis_scp"."scp_ss_planning_item" USING btree (
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(demand_unit_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_category_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(product_hierarchy_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_ss_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_ss_planning_item" ADD CONSTRAINT "scp_ss_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_summary_data
-- ----------------------------
CREATE UNIQUE INDEX "scp_summary_data_workbench_code_idx" ON "themetis_scp"."scp_summary_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "summary_data_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "summary_data_key" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_summary_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_summary_data" ADD CONSTRAINT "scp_summary_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table scp_summary_data_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_summary_data_item" ADD CONSTRAINT "md_summary_data_type_attribute_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_year_plan_bucket_data
-- ----------------------------
CREATE INDEX "scp_year_plan_bucket_data_idx01" ON "themetis_scp"."scp_year_plan_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_bucket_data_idx1" ON "themetis_scp"."scp_year_plan_bucket_data" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_bucket_data_idx2" ON "themetis_scp"."scp_year_plan_bucket_data" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_year_plan_bucket_data_uidx" ON "themetis_scp"."scp_year_plan_bucket_data" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_year_plan_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_year_plan_bucket_data" ADD CONSTRAINT "scp_year_plan_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_year_plan_bucket_data_copy1
-- ----------------------------
CREATE INDEX "scp_year_plan_bucket_data_idx01_copy1" ON "themetis_scp"."scp_year_plan_bucket_data_copy1" USING btree (
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "head_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_bucket_data_idx1_copy1" ON "themetis_scp"."scp_year_plan_bucket_data_copy1" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_bucket_data_idx2_copy1" ON "themetis_scp"."scp_year_plan_bucket_data_copy1" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_year_plan_bucket_data_uidx_copy1" ON "themetis_scp"."scp_year_plan_bucket_data_copy1" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_year_plan_bucket_data_copy1
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_year_plan_bucket_data_copy1" ADD CONSTRAINT "scp_year_plan_bucket_data_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_year_plan_planning_item
-- ----------------------------
CREATE INDEX "scp_year_plan_planning_item_idx1" ON "themetis_scp"."scp_year_plan_planning_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_planning_item_idx2" ON "themetis_scp"."scp_year_plan_planning_item" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_planning_item_idx3" ON "themetis_scp"."scp_year_plan_planning_item" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_year_plan_planning_item_uidx" ON "themetis_scp"."scp_year_plan_planning_item" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_year_plan_planning_item
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_year_plan_planning_item" ADD CONSTRAINT "scp_year_plan_planning_item_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table scp_year_plan_planning_item_copy1
-- ----------------------------
CREATE INDEX "scp_year_plan_planning_item_idx1_copy1" ON "themetis_scp"."scp_year_plan_planning_item_copy1" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_planning_item_idx2_copy1" ON "themetis_scp"."scp_year_plan_planning_item_copy1" USING btree (
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "scp_year_plan_planning_item_idx3_copy1" ON "themetis_scp"."scp_year_plan_planning_item_copy1" USING btree (
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_year_plan_planning_item_uidx_copy1" ON "themetis_scp"."scp_year_plan_planning_item_copy1" USING btree (
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "demand_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_item_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_hierarchy_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "product_category_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_year_plan_planning_item_copy1
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_year_plan_planning_item_copy1" ADD CONSTRAINT "scp_year_plan_planning_item_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table sy_scp_ecn
-- ----------------------------
ALTER TABLE "themetis_scp"."sy_scp_ecn" ADD CONSTRAINT "sy_scp_fai_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table sy_scp_fai
-- ----------------------------
ALTER TABLE "themetis_scp"."sy_scp_fai" ADD CONSTRAINT "sy_scp_tran_phase_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table sy_scp_ied_inventory_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."sy_scp_ied_inventory_bucket_data" ADD CONSTRAINT "sy_scp_ied_inventory_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sy_scp_ied_inventory_item
-- ----------------------------
CREATE INDEX "scp_dp_planning_item_idx1_copy1" ON "themetis_scp"."sy_scp_ied_inventory_item" USING btree (
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table sy_scp_ied_inventory_item
-- ----------------------------
ALTER TABLE "themetis_scp"."sy_scp_ied_inventory_item" ADD CONSTRAINT "scp_dp_planning_item_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table sy_scp_order_task
-- ----------------------------
ALTER TABLE "themetis_scp"."sy_scp_order_task" ADD CONSTRAINT "sy_order_task_pkey" PRIMARY KEY ("order_no", "task_operation_type_no", "task_operation_no");

-- ----------------------------
-- Primary Key structure for table sy_scp_tran_phase
-- ----------------------------
ALTER TABLE "themetis_scp"."sy_scp_tran_phase" ADD CONSTRAINT "scp_approval_log_copy1_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table tmp$scp_raw_pegging_bucket_data
-- ----------------------------
CREATE INDEX "idx_tmp$scp_raw_pegging_bucket_data_n1" ON "themetis_scp"."tmp$scp_raw_pegging_bucket_data" USING btree (
  "tenant_id" "pg_catalog"."int4_ops" ASC NULLS LAST,
  "figure_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "bucket_field" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table tmp$scp_raw_pegging_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."tmp$scp_raw_pegging_bucket_data" ADD CONSTRAINT "tmp$scp_raw_pegging_bucket_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table tmp_mds_sim_priority
-- ----------------------------
CREATE INDEX "tmp_mds_sim_priority_idx1" ON "themetis_scp"."tmp_mds_sim_priority" USING btree (
  "order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "order_line_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table wb_custom_master_data_type
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_custom_master_data_type" ADD CONSTRAINT "wb_custom_master_data_type_pkey" PRIMARY KEY ("tenant_id", "master_data_type_code");

-- ----------------------------
-- Primary Key structure for table wb_custom_meta_attribute
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_custom_meta_attribute" ADD CONSTRAINT "wb_custom_meta_attribute_pkey" PRIMARY KEY ("tenant_id", "meta_attribute_code");

-- ----------------------------
-- Primary Key structure for table wb_custom_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_custom_order_data" ADD CONSTRAINT "wb_custom_order_data_pkey" PRIMARY KEY ("tenant_id", "order_data_type_code", "workbench_code", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_custom_order_data_type
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_custom_order_data_type" ADD CONSTRAINT "wb_custom_order_data_type_pkey" PRIMARY KEY ("tenant_id", "order_data_type_code");

-- ----------------------------
-- Primary Key structure for table wb_custom_query
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_custom_query" ADD CONSTRAINT "wb_custom_query_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table wb_custom_query_condition
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_custom_query_condition" ADD CONSTRAINT "wb_custom_query_condition_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table wb_custom_query_config
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_custom_query_config" ADD CONSTRAINT "wb_custom_query_config_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table wb_data_source
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_data_source" ADD CONSTRAINT "wb_data_source_pkey" PRIMARY KEY ("tenant_id", "data_source_code");

-- ----------------------------
-- Primary Key structure for table wb_demand_network
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_demand_network" ADD CONSTRAINT "wb_demand_network_pkey" PRIMARY KEY ("tenant_id", "demand_network_code");

-- ----------------------------
-- Primary Key structure for table wb_demand_plan_md_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_demand_plan_md_data" ADD CONSTRAINT "wb_demand_plan_md_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "demand_network_code", "demand_unit_code", "master_data_key");

-- ----------------------------
-- Primary Key structure for table wb_demand_supply_route
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_demand_supply_route" ADD CONSTRAINT "wb_demand_supply_route_pkey" PRIMARY KEY ("tenant_id", "supply_route_code", "demand_unit_code", "supply_unit_code");

-- ----------------------------
-- Primary Key structure for table wb_demand_unit
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_demand_unit" ADD CONSTRAINT "wb_demand_unit_pkey" PRIMARY KEY ("tenant_id", "demand_network_code", "demand_unit_code");

-- ----------------------------
-- Primary Key structure for table wb_demand_unit_hierarchy
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_demand_unit_hierarchy" ADD CONSTRAINT "wb_demand_unit_hierarchy_pkey" PRIMARY KEY ("tenant_id", "demand_network_code", "demand_unit_code", "parent_unit_code");

-- ----------------------------
-- Primary Key structure for table wb_dp_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_dp_bucket_data" ADD CONSTRAINT "wb_dp_bucket_data_pkey" PRIMARY KEY ("tenant_id", "demand_network_code", "demand_unit_code", "master_data_key", "workbench_code", "plan_period_code");

-- ----------------------------
-- Primary Key structure for table wb_fcst_fulfillment_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_fcst_fulfillment_order_data" ADD CONSTRAINT "wb_fcst_fulfillment_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "demand_network_code", "demand_unit_code", "supply_network_code", "supply_unit_code", "demand_plan_no", "order_data_key", "fulfillment_line_no");

-- ----------------------------
-- Primary Key structure for table wb_figure_type
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_figure_type" ADD CONSTRAINT "wb_figure_type_pkey" PRIMARY KEY ("tenant_id", "figure_type_code");

-- ----------------------------
-- Primary Key structure for table wb_forecast_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_forecast_order_data" ADD CONSTRAINT "wb_forecast_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "demand_network_code", "demand_unit_code", "supply_network_code", "supply_unit_code", "demand_plan_no", "demand_plan_line_no", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_item_supply_path
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_item_supply_path" ADD CONSTRAINT "wb_item_supply_path_pkey" PRIMARY KEY ("tenant_id", "supply_path_code");

-- ----------------------------
-- Primary Key structure for table wb_master_data_type_attribute
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_master_data_type_attribute" ADD CONSTRAINT "wb_master_data_type_attribute_pkey" PRIMARY KEY ("tenant_id", "master_data_type_code", "meta_attribute_code");

-- ----------------------------
-- Primary Key structure for table wb_master_plan_md_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_master_plan_md_data" ADD CONSTRAINT "wb_master_plan_md_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "master_data_key");

-- ----------------------------
-- Primary Key structure for table wb_material
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_material" ADD CONSTRAINT "wb_material_pkey" PRIMARY KEY ("tenant_id", "supply_network_code", "supply_unit_code", "material");

-- ----------------------------
-- Primary Key structure for table wb_mp_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_mp_bucket_data" ADD CONSTRAINT "wb_mp_bucket_data_pkey" PRIMARY KEY ("tenant_id", "supply_network_code", "supply_unit_code", "master_data_key", "workbench_code", "plan_period_code");

-- ----------------------------
-- Primary Key structure for table wb_order_data_type_attribute
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_order_data_type_attribute" ADD CONSTRAINT "wb_order_data_type_attribute_pkey" PRIMARY KEY ("tenant_id", "order_data_type_code", "meta_attribute_code");

-- ----------------------------
-- Primary Key structure for table wb_plan_bucket_type
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_plan_bucket_type" ADD CONSTRAINT "wb_plan_bucket_type_pkey" PRIMARY KEY ("tenant_id", "bucket_type_code");

-- ----------------------------
-- Primary Key structure for table wb_planned_component_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planned_component_order_data" ADD CONSTRAINT "wb_planned_component_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "production_order_no", "production_order_line_no", "plan_period_code", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_planned_operation_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planned_operation_order_data" ADD CONSTRAINT "wb_planned_operation_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "production_order_no", "plan_period_code", "operation_seq_no", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_planned_product_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planned_product_order_data" ADD CONSTRAINT "wb_planned_product_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "production_order_no", "plan_period_code", "production_order_product_no", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_planned_production_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planned_production_order_data" ADD CONSTRAINT "wb_planned_production_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "production_order_no", "plan_period_code", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_planned_purchase_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planned_purchase_order_data" ADD CONSTRAINT "wb_planned_purchase_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "planned_purchase_order_no", "plan_period_code", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_planned_resource_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planned_resource_order_data" ADD CONSTRAINT "wb_planned_resource_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "production_order_no", "plan_period_code", "operation_seq_no", "resource_no", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_planner
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planner" ADD CONSTRAINT "wb_planner_pkey" PRIMARY KEY ("tenant_id", "planner_code");

-- ----------------------------
-- Primary Key structure for table wb_planner_workbench
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_planner_workbench" ADD CONSTRAINT "wb_planner_workbench_pkey" PRIMARY KEY ("tenant_id", "workbench_code");

-- ----------------------------
-- Primary Key structure for table wb_product_attach_rate
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_product_attach_rate" ADD CONSTRAINT "wb_product_attach_rate_pkey" PRIMARY KEY ("tenant_id", "product_hierarchy_code", "product_category_code", "material");

-- ----------------------------
-- Primary Key structure for table wb_product_category
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_product_category" ADD CONSTRAINT "wb_product_category_pkey" PRIMARY KEY ("tenant_id", "product_category_code");

-- ----------------------------
-- Primary Key structure for table wb_product_hierarchy
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_product_hierarchy" ADD CONSTRAINT "wb_product_hierarchy_pkey" PRIMARY KEY ("tenant_id", "product_hierarchy_code", "product_category_code");

-- ----------------------------
-- Primary Key structure for table wb_sales_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_sales_order_data" ADD CONSTRAINT "wb_sales_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "order_no", "order_line_no", "schedule_line_no", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_so_fulfillment_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_so_fulfillment_order_data" ADD CONSTRAINT "wb_so_fulfillment_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "order_no", "order_data_key", "fulfillment_line_no");

-- ----------------------------
-- Primary Key structure for table wb_sop_bucket_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_sop_bucket_data" ADD CONSTRAINT "wb_sop_bucket_data_pkey" PRIMARY KEY ("tenant_id", "demand_network_code", "demand_unit_code", "supply_network_code", "supply_unit_code", "master_data_key", "workbench_code", "plan_period_code");

-- ----------------------------
-- Primary Key structure for table wb_sop_md_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_sop_md_data" ADD CONSTRAINT "wb_sop_md_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "demand_network_code", "demand_unit_code", "supply_network_code", "supply_unit_code", "master_data_key");

-- ----------------------------
-- Primary Key structure for table wb_supply_network
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_supply_network" ADD CONSTRAINT "wb_supply_network_pkey" PRIMARY KEY ("tenant_id", "supply_network_code");

-- ----------------------------
-- Primary Key structure for table wb_supply_order_data
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_supply_order_data" ADD CONSTRAINT "wb_supply_order_data_pkey" PRIMARY KEY ("tenant_id", "workbench_code", "supply_network_code", "supply_unit_code", "supply_order_no", "supply_order_line_no", "supply_order_shipment_no", "order_data_key");

-- ----------------------------
-- Primary Key structure for table wb_supply_unit
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_supply_unit" ADD CONSTRAINT "wb_supply_unit_pkey" PRIMARY KEY ("tenant_id", "supply_network_code", "supply_unit_code");

-- ----------------------------
-- Primary Key structure for table wb_unit_supply_path
-- ----------------------------
ALTER TABLE "themetis_scp"."wb_unit_supply_path" ADD CONSTRAINT "wb_unit_supply_path_pkey" PRIMARY KEY ("tenant_id", "supply_path_code");

-- ----------------------------
-- Indexes structure for table scp_planned_purchase_order
-- ----------------------------
CREATE INDEX "idx_scp_planned_purchase_order_last_update_date" ON "themetis_scp"."scp_planned_purchase_order" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "last_update_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "idx_scp_planned_purchase_order_wb_ppc_pc_tid_status" ON "themetis_scp"."scp_planned_purchase_order" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planner_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "status" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_purchase_order_idx1" ON "themetis_scp"."scp_planned_purchase_order" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "mrp_release_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST,
  "mrp_request_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "scp_planned_purchase_order_idx5" ON "themetis_scp"."scp_planned_purchase_order" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "last_update_date" "pg_catalog"."timestamp_ops" DESC NULLS FIRST,
  "id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_purchase_order_uidx" ON "themetis_scp"."scp_planned_purchase_order" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material_revision" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "attribute_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "customer_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "contract_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "project_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "supplier_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "production_delivery_method" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "scp_planned_purchase_order_uidx_n" ON "themetis_scp"."scp_planned_purchase_order" USING btree (
  "planning_period_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "workbench_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planning_period_type_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "supply_unit_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(attribute_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(contract_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(customer_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(material_revision, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(production_delivery_method, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(project_code, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  COALESCE(supplier_no, '-999'::character varying) COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "material" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "planned_purchase_order_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table scp_planned_purchase_order
-- ----------------------------
ALTER TABLE "themetis_scp"."scp_planned_purchase_order" ADD CONSTRAINT "scp_planned_purchase_order_pkey" PRIMARY KEY ("id", "planning_period_code");
