CREATE TABLE "ecc"."T_CHANGE_PR" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."T_CHANGE_PR_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"BANFN" varchar(255) NOT NULL,
	"BANPO" varchar(255) NOT NULL,
	"ZCHG_NO" varchar(255) NOT NULL,
	"ZACC_IND" varchar(255),
	"PCR_REQ" varchar(255),
	"PCR_REQ_SEQ" varchar(255),
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "ecc"."ZMM_DT" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."ZMM_DT_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"EBELN" varchar(255) NOT NULL,
	"EBELP" varchar(255),
	"LOEKZ" varchar(255),
	"AEDAT" varchar(255),
	"MAKTX" varchar(255),
	"MATKL" varchar(255),
	"MATNR" varchar(255),
	"WERKS" varchar(255),
	"LGORT" varchar(255),
	"BEDNR" varchar(255),
	"MENGE" varchar(255),
	"NETPR" varchar(255),
	"PEINH" varchar(255),
	"NETWR" varchar(255),
	"BRTWR" varchar(255),
	"WEBAZ" varchar(255),
	"MWSKZ" varchar(255),
	"INSMK" varchar(255),
	"BWTAR" varchar(255),
	"BWTTY" varchar(255),
	"ELIKZ" varchar(255),
	"EREKZ" varchar(255),
	"TWRKZ" varchar(255),
	"REPOS" varchar(255),
	"WEBRE" varchar(255),
	"KNTTP" varchar(255),
	"NTGEW" varchar(255),
	"GEWEI" varchar(255),
	"BRGEW" varchar(255),
	"VOLUM" varchar(255),
	"VOLEH" varchar(255),
	"BANFN" varchar(255),
	"BNFPO" varchar(255),
	"UPTYP" varchar(255),
	"UPVOR" varchar(255),
	"ZPO_DLV_DT" varchar(255),
	"ZSHIP_DT" varchar(255),
	"ZDST_CD" varchar(255),
	"ZRCV_DT" varchar(255),
	"ZCON_NO" varchar(255),
	"ZCON_IND" varchar(255),
	"ZCHAR_CD" varchar(255),
	"ZMAT_AREA" varchar(255),
	"ZSZ" varchar(255),
	"ZAF_ECAL_AMT" varchar(255),
	"ZPLN_ST_DT" varchar(255),
	"ZPLN_ED_DT" varchar(255),
	"PSPID" varchar(255),
	"ZUSD_BGT" varchar(255),
	"ZKRW_BGT" varchar(255),
	"ZDLV_CNTLR" varchar(255),
	"ANFNR" varchar(255),
	"ANFPS" varchar(255),
	"KONNR" varchar(255),
	"KTPNR" varchar(255),
	"ZCR_NO" varchar(255),
	"ZCR_AMT" varchar(255),
	"ZRT_CUR" varchar(255),
	"ZRT_AMT" varchar(255),
	"ZPO_UNIT" varchar(255),
	"ZREF_NETPR" varchar(255),
	"ZNETPR" varchar(255),
	"BPRME" varchar(255),
	"ZDISPLN" varchar(255),
	"ZORCT_CNRT_KRW" varchar(255),
	"ZORCT_CNRT_USD" varchar(255),
	"ZETC_CNRT_KRW" varchar(255),
	"ZETC_CNRT_USD" varchar(255),
	"ZEXTRA_AMT" varchar(255),
	"ZCRDT_AMT" varchar(255),
	"ZART" varchar(255),
	"ART" varchar(255),
	"ZPDT_BSE_UPR" varchar(255),
	"ZPDT_EXTRA_UPR" varchar(255),
	"ZPDT_EXDS_AMT" varchar(255),
	"ZTRNS_UPR" varchar(255),
	"ZFST_DST_CD" varchar(255),
	"ZCHG_CHK" varchar(255),
	"ZITP_CHK" varchar(255),
	"ZPO_RMK" varchar(255),
	"ZPO_LOT_NO" varchar(255),
	"ZCLM_NO" varchar(255),
	"ZWH_CNTLR" varchar(255),
	"LFDAT" varchar(255),
	"ETC_2" varchar(255),
	"ETC_3" varchar(255),
	"ETC_4" varchar(255),
	"ETC_5" varchar(255),
	"ETC_6" varchar(255),
	"ETC_7" varchar(255),
	"ETC_8" varchar(255),
	"ETC_9" varchar(255),
	"ETC_10" varchar(255),
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "ecc"."ZMM_HD" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."ZMM_HD_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"EBELN" varchar(255) NOT NULL,
	"BUKRS" varchar(255),
	"BSTYP" varchar(255),
	"BSART" varchar(255),
	"LOEKZ" varchar(255),
	"AEDAT" varchar(255),
	"ERNAM" varchar(255),
	"LIFNR" varchar(255),
	"ZTERM" varchar(255),
	"EKORG" varchar(255),
	"EKGRP" varchar(255),
	"WKURS" varchar(255),
	"BEDAT" varchar(255),
	"INCO1" varchar(255),
	"ZSHIPMT_PLC_CD" varchar(255),
	"ZUNLD_PLC_CD" varchar(255),
	"ZIND_CD" varchar(255),
	"ZDAMT_DD_SUBRT" varchar(255),
	"ZMAX_SUBRT" varchar(255),
	"ZCNRT_GRNT_CD" varchar(255),
	"ZDFCT_GRNT_CD" varchar(255),
	"ZGRNT_PRD_CD" varchar(255),
	"ZPAMT_YN" varchar(255),
	"ZBGT_AMT" varchar(255),
	"ZBGT_CURR" varchar(255),
	"ZPO_AMT" varchar(255),
	"ZPO_AMT_KRW" varchar(255),
	"ZPO_CURR" varchar(255),
	"ZCHG_PO_DT" varchar(255),
	"ZPO_CNFM_STAT" varchar(255),
	"ZOWN_AGR_IND_YN" varchar(255),
	"ZELC_AGR_DT" varchar(255),
	"ZELC_AGR_TM" varchar(255),
	"ZELC_CNRT_ND_YN" varchar(255),
	"ZPO_DT" varchar(255),
	"ZPLN_INO_GB" varchar(255),
	"ZECAL_BSE" varchar(255),
	"ZWGT_ECAL_GB" varchar(255),
	"ZPO_TRANS_DT" varchar(255),
	"ZPO_TRANS_CANC" varchar(255),
	"ZVST_TMS" varchar(255),
	"ZSVC_WK_PRD" varchar(255),
	"ZDT_EXCS_AMT" varchar(255),
	"ZDT_EXCS_AMT2" varchar(255),
	"ZDT_EXCS_AMT3" varchar(255),
	"ZSVC_CNRT_CUR" varchar(255),
	"ZPAY_GB" varchar(255),
	"ZFULL_COMM" varchar(255),
	"PSPID" varchar(255),
	"ZCON_NO" varchar(255),
	"ZTITLE" varchar(255),
	"ZPO_VER" varchar(255),
	"ITEM_CATEGORY" varchar(255),
	"LTEXT" varchar(255),
	"ITEM_NO" varchar(255),
	"USECD" varchar(255),
	"ETC_2" varchar(255),
	"ETC_3" varchar(255),
	"ETC_4" varchar(255),
	"ETC_5" varchar(255),
	"ETC_6" varchar(255),
	"ETC_7" varchar(255),
	"ETC_8" varchar(255),
	"ETC_9" varchar(255),
	"ETC_10" varchar(255),
	"ZDLV_PRICE_T" varchar(255),
	"ZWEBELN" varchar(255),
	"ZVER_NO" varchar(255),
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL,
	CONSTRAINT "ZMM_HD_EBELN_unique" UNIQUE("EBELN")
);
--> statement-breakpoint
CREATE TABLE "ecc"."ZMM_KN" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."ZMM_KN_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"EBELN" varchar(255) NOT NULL,
	"EBELP" varchar(255) NOT NULL,
	"ZEKKN" varchar(255),
	"SAKTO" varchar(255),
	"GSBER" varchar(255),
	"KOSTL" varchar(255),
	"VBELN" varchar(255),
	"VBELP" varchar(255),
	"ANLN1" varchar(255),
	"ANLN2" varchar(255),
	"AUFNR" varchar(255),
	"WEMPF" varchar(255),
	"ABLAD" varchar(255),
	"KOKRS" varchar(255),
	"PRCTR" varchar(255),
	"NPLNR" varchar(255),
	"AUFPL" varchar(255),
	"APLZL" varchar(255),
	"FIPOS" varchar(255),
	"FISTL" varchar(255),
	"GEBER" varchar(255),
	"VORNR" varchar(255),
	"POSID" varchar(255),
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "ecc"."ZMM_NOTE" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."ZMM_NOTE_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"EBELN" varchar(255) NOT NULL,
	"ZNOTE_SER" varchar(255) NOT NULL,
	"ZNOTE_TXT" varchar(10000) NOT NULL,
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "ecc"."ZMM_NOTE2" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."ZMM_NOTE2_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"EBELN" varchar(255) NOT NULL,
	"ZDLV_PRICE_SER" varchar(255) NOT NULL,
	"ZDLV_PRICE_NOTE" varchar(10000) NOT NULL,
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "ecc"."ZMM_PAY" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."ZMM_PAY_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"EBELN" varchar(255) NOT NULL,
	"ZPAYSEQ" varchar(255) NOT NULL,
	"ZADVTYP" varchar(255),
	"ZDWPRT" varchar(255),
	"ZDWPAMT" varchar(255),
	"ZDWPDAT" varchar(255),
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "ecc"."ZMM_PCR" (
	"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ecc"."ZMM_PCR_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
	"PCR_REQ" varchar(255) NOT NULL,
	"PCR_REQ_SEQ" varchar(255) NOT NULL,
	"PCR_REQ_DATE" varchar(255) NOT NULL,
	"EBELN" varchar(255) NOT NULL,
	"EBELP" varchar(255) NOT NULL,
	"PCR_TYPE" varchar(255) NOT NULL,
	"PSPID" varchar(255),
	"BANFN" varchar(255) NOT NULL,
	"BNFPO" varchar(255) NOT NULL,
	"MATNR" varchar(255),
	"MAKTX" varchar(255),
	"ZZSPEC" varchar(255),
	"ZSPEC_NUM" varchar(255),
	"QTY_B" varchar(255),
	"QTY_A" varchar(255),
	"MEINS" varchar(255),
	"T_WEIGHT_B" varchar(255),
	"T_WEIGHT_A" varchar(255),
	"MEINS_W" varchar(255),
	"S_WEIGHT_B" varchar(255),
	"S_WEIGHT_A" varchar(255),
	"C_WEIGHT_B" varchar(255),
	"C_WEIGHT_A" varchar(255),
	"ZACC_DT" varchar(255),
	"ERDAT" varchar(255),
	"DEPTCD" varchar(255),
	"DEPTNM" varchar(255),
	"EMPID" varchar(255),
	"NAME" varchar(255),
	"LIFNR" varchar(255),
	"NAME1" varchar(255),
	"ZPROC_IND" varchar(255),
	"LFDAT" varchar(255),
	"WAERS" varchar(255),
	"NETPR" varchar(255),
	"PEINH" varchar(255),
	"NETWR" varchar(255),
	"POSID" varchar(255),
	"EKGRP" varchar(255),
	"EKNAM" varchar(255),
	"ZCHG_NO" varchar(255),
	"DOKNR" varchar(255),
	"DOKAR" varchar(255),
	"DOKTL" varchar(255),
	"DOKVR" varchar(255),
	"ZAEDAT" varchar(255),
	"WERKS" varchar(255),
	"REQUEST_CD" varchar(255),
	"REQUEST_RSN" varchar(255),
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL,
	CONSTRAINT "ZMM_PCR_PCR_REQ_unique" UNIQUE("PCR_REQ")
);
--> statement-breakpoint
ALTER TABLE "ecc"."ZMM_DT" ADD CONSTRAINT "ZMM_DT_EBELN_ZMM_HD_EBELN_fk" FOREIGN KEY ("EBELN") REFERENCES "ecc"."ZMM_HD"("EBELN") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "ecc"."ZMM_KN" ADD CONSTRAINT "ZMM_KN_EBELN_ZMM_HD_EBELN_fk" FOREIGN KEY ("EBELN") REFERENCES "ecc"."ZMM_HD"("EBELN") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "ecc"."ZMM_NOTE" ADD CONSTRAINT "ZMM_NOTE_EBELN_ZMM_HD_EBELN_fk" FOREIGN KEY ("EBELN") REFERENCES "ecc"."ZMM_HD"("EBELN") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "ecc"."ZMM_NOTE2" ADD CONSTRAINT "ZMM_NOTE2_EBELN_ZMM_HD_EBELN_fk" FOREIGN KEY ("EBELN") REFERENCES "ecc"."ZMM_HD"("EBELN") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "ecc"."ZMM_PAY" ADD CONSTRAINT "ZMM_PAY_EBELN_ZMM_HD_EBELN_fk" FOREIGN KEY ("EBELN") REFERENCES "ecc"."ZMM_HD"("EBELN") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "ecc"."PR_INFORMATION_T_BID_ITEM" ADD CONSTRAINT "PR_INFORMATION_T_BID_ITEM_ANFNR_PR_INFORMATION_T_BID_HEADER_ANFNR_fk" FOREIGN KEY ("ANFNR") REFERENCES "ecc"."PR_INFORMATION_T_BID_HEADER"("ANFNR") ON DELETE no action ON UPDATE no action;