CREATE TABLE if not exists public.s_job (
	recid int NOT NULL,
	analysiscode1 text NULL,
	analysiscode2 text NULL,
	analysiscode3 text NULL,
	analysiscode4 text NULL,
	analysiscode5 text NULL,
	approvestatus text NULL,
	approveversion int NULL,
	assignedby text NULL,
	assigneddate timestamp NULL,
	assigneddesc text NULL,
	assignedscenaro bit NULL,
	buildmode text NULL,
	caminstruct varchar(1000) NULL,
	"comment" varchar(2000) NULL,
	createby text NULL,
	createdate timestamp NULL,
	culayers int NULL,
	datecode text NULL,
	delivery_x int NULL,
	delivery_y int NULL,
	designby text NULL,
	drills int NULL,
	enableapproval bit NULL,
	inactive bit NULL,
	isassigned bit NULL,
	issymmetry bit NULL,
	jobstatus varchar(50) NULL,
	leadtime int NULL,
	legendbot int NULL,
	legendtop int NULL,
	lotsize int NULL,
	maxpartlevel int NULL,
	mfgtime int NULL,
	minotes text NULL,
	originalstatus varchar(50) NULL,
	panellen numeric(20, 4) NULL,
	panellen_b numeric(20, 4) NULL,
	panelwid numeric(20, 4) NULL,
	panelwid_b numeric(20, 4) NULL,
	partarea numeric(20, 8) NULL,
	partflag text NULL,
	parthigh numeric(20, 4) NULL,
	partlength numeric(20, 4) NULL,
	partname varchar(200) NULL,
	partnum varchar(50) NULL,
	partrev text NULL,
	partwid numeric(20, 4) NULL,
	pcsofarray int NULL,
	pcsofpanel int NULL,
	pcsofpanel_b int NULL,
	pdid varchar(100) NULL,
	piid varchar(100) NULL,
	planonhold bit NULL,
	pnlofsheet int NULL,
	pnlofsheet_b int NULL,
	releaseonhold bit NULL,
	routs int NULL,
	scraprate numeric(20, 4) NULL,
	setqty int NULL,
	shelflife int NULL,
	smbot int NULL,
	smtop int NULL,
	soonhold bit NULL,
	"status" varchar(50) NULL,
	unitweight numeric(20, 8) NULL,
	"version" int NULL,
	xoutmaxqty int NULL,
	projectcombinationid int NULL,
	assigneduserid int NULL,
	companyid int NULL,
	creatorid int NOT NULL,
	deliveryunitid int NOT NULL,
	flowtypeid int NULL,
	postroleid int NULL,
	productgroupid int NULL,
	partid int NULL,
	scenaroid int NULL,
	customerid int NULL,
	saleprojectid int NULL,
	isimportmi bit NULL,
	modifiedby varchar(50) NULL,
	lastmodifydate timestamp NULL,
	departmentid int NULL,
	paneltype varchar(50) NULL,
	ifhadsmt bit NULL,
	usedrateofsheet numeric(20, 4) NULL,
	sheetlen numeric(20, 4) NULL,
	sheetwid numeric(20, 4) NULL,
	"type" varchar(20) NULL,
	filmmode varchar(50) NULL,
	packings varchar(100) NULL,
	panelizernotes text NULL,
	qtyofpn int NULL,
	setofpnl int NULL,
	costflag bit NULL,
	costcaluserid int NULL,
	costcaldate timestamp NULL,
	costcalnotes text NULL,
	onholdnotes text NULL,
	receipttime timestamp NULL,
	planfinishtime timestamp NULL,
	eqsendtime timestamp NULL,
	eqreplytime timestamp NULL,
	eqfinishtime timestamp NULL,
	mifinishtime timestamp NULL,
	eqnotes varchar(200) NULL,
	halogenfree bit NULL,
	grossweight numeric(20, 8) NULL,
	stackupnotes varchar(1000) NULL,
	progressstatus varchar(50) NULL,
	productgradeid int NULL,
	appcategoryid int NULL,
	cartonsid int NULL,
	spacermatid int NULL,
	packmatid int NULL,
	qtyofbagpercarton int NULL,
	qtyofarrayperbag int NULL,
	ifmixdatecode bit NULL,
	ifmixxoutcarton bit NULL,
	ifmixxoutpack bit NULL,
	plantid int NULL,
	isnewversion bit NULL,
	prevversion_jobid int NULL,
	residueslen numeric(20, 4) NULL,
	residueswid numeric(20, 4) NULL,
	residuesrateofsheet numeric(20, 4) NULL,
	wonum int NULL,
	rack varchar(50) NULL,
	panelizerjsondata varchar(100) NULL,
	custpacknumtype varchar(30) NULL,
	inpackingreporturl varchar(100) NULL,
	outpackingreporturl varchar(100) NULL,
	inplantpackingreporturl varchar(100) NULL,
	outplantpackingreporturl varchar(100) NULL,
	submitdate timestamp NULL,
	ifsubstitutesuppliers bit NULL,
	laminatedthick numeric(20, 4) NULL,
	lamthickpostol numeric(20, 4) NULL,
	lamthicknegtol numeric(20, 4) NULL,
	outlineapproved bit NULL,
	isimportfromdatafile bit NULL,
	importstackupimg bit NULL,
	custmatcode varchar(200) NULL,
	endcustomerid int NULL,
	endcustomer varchar(50) NULL,
	bomtypecode varchar(50) NULL,
	hadguestquest char(1) NULL,
	maxrate numeric(20, 4) NULL,
	surface varchar(50) NULL,
	etching varchar(50) NULL,
	cuthick numeric(20, 4) NULL,
	isthickcopper bit NULL,
	pa1 varchar(50) NULL,
	pa2 varchar(50) NULL,
	pa3 varchar(50) NULL,
	pa4 varchar(50) NULL,
	pa5 varchar(50) NULL,
	cartonnetweight numeric(20, 8) NULL,
	packgrossweight numeric(20, 8) NULL,
	packnetweight numeric(20, 8) NULL,
	forceddc bit NULL,
	parentid int NULL,
	inner_scraperate numeric(20, 4) NULL,
	ifcalwasteunit bit NULL,
	arrayweight numeric(20, 8) NULL,
	calwasteunitdate timestamp NULL,
	wastecalmsg text NULL,
	projectname varchar(50) NULL,
	samewarpzonal bit NULL,
	endcustpartnum varchar(100) NULL,
	endcustpartdesc varchar(100) NULL,
	endcustpartrev varchar(100) NULL,
	smtbomstatus varchar(50) NULL,
	smtbomproducerid int NULL,
	smtbomproducetime timestamp NULL,
	smtbomsenderid int NULL,
	smtbomsendtime timestamp NULL,
	smtbomapproverid int NULL,
	smtbomapprovaltime timestamp NULL,
	smtbomprocesscode varchar(50) NULL,
	auxmatprocess text NULL,
	jobgroupid int NULL,
	packingmodifydate timestamp NULL,
	packingmodifyuserid int NULL,
	qualityonhold bit NULL,
	salenote varchar(1000) NULL,
	camstatus varchar(20) NULL,
	camassignid int NULL,
	camassigndate timestamp NULL,
	camassigntoid int NULL,
	camsubmitid int NULL,
	camsubmitdate timestamp NULL,
	camsubmittoid int NULL,
	camfinishid int NULL,
	camfinishdate timestamp NULL,
	camnotes varchar(250) NULL,
	maxsampleoutput int NULL,
	extrapartnum varchar(50) NULL,
	qtyofbagperpack int NULL,
	qtyofpackpercase int NULL,
	qtyofcasepercarton int NULL,
	prequalify bit NULL,
	prequalifyno varchar(50) NULL,
	fromprejobid int NULL,
	panelizeid int NULL,
	gbsenttime timestamp NULL,
	gbreplytime timestamp NULL,
	interface_out int NULL,
	interface_out2 int NULL,
	packinsidematid int NULL,
	ifinterfacesynchronization bit NOT NULL,
	isgensalespart bit NULL,
	routetype int NULL,
	panelarea numeric(20, 6) NULL,
	panelarea_b numeric(20, 6) NULL,
	pcslen numeric(20, 6) NULL,
	pcswid numeric(20, 6) NULL,
	pcsarea numeric(20, 8) NULL,
	xnh_sourceid varchar(50) NULL,
	istearing bit NULL,
	firstassigntime timestamp NULL,
	firstassigntoid int NULL,
	firstfinishtime timestamp NULL,
	secondassigntime timestamp NULL,
	secondassigntoid int NULL,
	secondfinishtime timestamp NULL,
	camcheckassigntoid int NULL,
	camcheckassigntime timestamp NULL,
	specsort int NULL,
	setnetweightupperlimit decimal(28, 10) NULL,
	setnetweightlowerlimit decimal(28, 10) NULL,
	packagematerialsupperlimit decimal(28, 10) NULL,
	packagematerialslowerlimit decimal(28, 10) NULL,
	cartonmaterialsupperlimit decimal(28, 10) NULL,
	cartonmaterialslowerlimit decimal(28, 10) NULL,
	maxforkplates int NULL,
	acceptforkplatescheck bit NOT NULL,
	weeklycheck bit NULL,
	forkplatesordergeneration bit NULL,
	mixedforkpacking bit NULL,
	sheetnotes varchar(50) NULL,
	panelanotes varchar(50) NULL,
	panelbnotes varchar(50) NULL,
	packagingmethod varchar(50) NULL,
	paperseparationmethod varchar(50) NULL,
	packetenvironmentallabeling varchar(50) NULL,
	desiccantrequirements varchar(50) NULL,
	humiditycardrequirements varchar(50) NULL,
	isthehumiditycardpaddedwithpaper varchar(50) NULL,
	innerprotectiveangle varchar(50) NULL,
	requirementsforbaseplate varchar(50) NULL,
	packetspecialrequirements varchar(50) NULL,
	storagetime varchar(50) NULL,
	forkplaterequirements varchar(50) NULL,
	numberofouterboxes varchar(50) NULL,
	weightrequirements varchar(50) NULL,
	cartontype varchar(50) NULL,
	environmentallabeling varchar(50) NULL,
	labelingposition varchar(50) NULL,
	numberofouterboxlabels varchar(50) NULL,
	specialrequirements varchar(50) NULL,
	specialidentification varchar(50) NULL,
	temporaryidentification varchar(50) NULL,
	otherspecialrequirementsone varchar(50) NULL,
	otherspecialrequirementstwo varchar(50) NULL,
	innerlayerlabel varchar(50) NULL,
	outerlabel varchar(50) NULL,
	otherrequirements varchar(50) NULL,
	fillstyle varchar(50) NULL,
	cartonsize varchar(50) NULL,
	mixedforksmallpackage bit NULL,
	processlibid int NULL,
	productspecialinformation text NULL,
	spischanged bit NULL,
	xmark numeric(10) NULL,
	miprintaddress text NULL,
	automaticallysendmapping int NULL,
	endsalespartname varchar(50) NULL,
	a_marginlen1 numeric(20, 2) NULL,
	a_marginlen2 numeric(20, 2) NULL,
	a_marginwid1 numeric(20, 2) NULL,
	a_marginwid2 numeric(20, 2) NULL,
	b_marginlen1 numeric(20, 2) NULL,
	b_marginlen2 numeric(20, 2) NULL,
	b_marginwid1 numeric(20, 2) NULL,
	b_marginwid2 numeric(20, 2) NULL,
	tracegranularity varchar(50) NULL,
	xflag numeric(2) NULL,
	approvalremarks text NULL,
	mixedlotpacking bit NULL,
	soonholdreason varchar(200) NULL,
	planonholdreason varchar(200) NULL,
	releaseonholdreason varchar(200) NULL,
	isecnprequalify bit NULL,
	panelize_setlen numeric(20, 4) NULL,
	panelize_setwid numeric(20, 4) NULL,
	panelize_setx int NULL,
	panelize_sety int NULL,
	panelize_setqty int NULL,
	usedratepanelofsheet numeric(20, 4) NULL,
	periodmandatorysmallpackage bit NULL,
	bomstatus varchar(50) NULL,
	ispackagingrunning bit NULL,
	benchmarkbyid int NULL,
	benchmarkbydate timestamp NULL,
	bomflowtypeid int NULL,
	bompiid varchar(100) NULL,
	bompdid varchar(100) NULL,
	trialproduction bit NOT NULL,
	ifquantitativerestriction bit NOT NULL,
	ifarealimitation bit NOT NULL,
	quantitativerestriction numeric(20, 2) NULL,
	arealimitation numeric(20, 2) NULL,
	reasonfortrialproduction text NULL,
	productstructureid int NULL,
	partnummatchinglabel bit NULL,
	ischeckbag bit NULL,
	ischeckpack bit NULL,
	ischeckcase bit NULL,
	ischeckbox bit NULL,
	ismodelriskplaceorder bit NULL,
	ismodelriskshipment bit NULL,
	packway varchar(50) NULL,
	checkway varchar(50) NULL,
	ecnupcopyinfo bit NULL,
	"uuid" varchar(200) NULL,
	bagfile varchar(200) NULL,
	packfile varchar(200) NULL,
	casefile varchar(200) NULL,
	boxfile varchar(200) NULL,
	bagprinter varchar(200) NULL,
	packprinter varchar(200) NULL,
	caseprinter varchar(200) NULL,
	boxprinter varchar(200) NULL,
	pdaallowmodifypackinfo bit NULL,
	packageprintactivationreview bit NULL,
	boardtypeid int NULL,
	packagebenchmarkjudgment bit NULL,
	legendcolor varchar(50) NULL,
	againapprovaluserid int NULL,
	combinecutid int NULL,
	commitmidate timestamp NULL,
	commitmiuserid int NULL,
	boxprintlabelquantity int NULL,
	quotno varchar(100) NULL,
	stockqty int NULL,
	endproid int NULL,
	classid int NULL,
	routtypeid int NULL,
	dcodeid int NULL,
	brand varchar(100) NULL,
	negative varchar(100) NULL,
	xnhsourceid varchar(100) NULL,
	pcsnetweight numeric(20, 8) NULL,
	boxgrossweightaddkg numeric(20, 8) NULL,
	packnetweightsubtractkg numeric(20, 8) NULL,
	deliveryratefailedreason text NULL,
	ifexport bit NULL,
	inputrecivedate timestamp NULL,
	inputstartdate timestamp NULL,
	inputfinishdate timestamp NULL,
	inputerrordate timestamp NULL,
	mireciveinfodate timestamp NULL,
	eqplanstartdate timestamp NULL,
	eqplanfinishdate timestamp NULL,
	ppesuspenddate timestamp NULL,
	miplanstartdate timestamp NULL,
	eqsendonemoredate timestamp NULL,
	eqreplyonemoredate timestamp NULL,
	exceedsability varchar(20) NULL,
	workdraftconfirm varchar(20) NULL,
	eqconfirmmat varchar(20) NULL,
	miproductcompletiondate timestamp NULL,
	micheckfinishdate timestamp NULL,
	miapproverid int NULL,
	physicalmodel varchar(100) NULL,
	stepsaid int NULL,
	stepsbid int NULL,
	baglabelformatid int NULL,
	packlabelformatid int NULL,
	caselabelformatid int NULL,
	boxlabelformatid int NULL,
	bagprinterb varchar(200) NULL,
	packprinterb varchar(200) NULL,
	caseprinterb varchar(200) NULL,
	boxprinterb varchar(200) NULL,
	qtyofpcsperbag int NULL,
	pdaallowboxprint bit NULL,
	fillquantity int NULL,
	qaeapproverid int NULL,
	qaeapprovedate timestamp NULL,
	qaeapprovestatus varchar(50) NULL,
	pnlwarptype int NULL,
	pnlwarpsize numeric(20, 4) NULL,
	setofpnlb int NULL,
	newproducttime timestamp NULL,
	ishadsetpanelize bit NULL,
	pcslenmargin decimal(18, 2) NULL,
	pcswidmargin decimal(18, 2) NULL,
	pcslengap decimal(18, 2) NULL,
	pcswidgap decimal(18, 2) NULL,
	setformx int NULL,
	setformy int NULL,
	unitlayoutmethod varchar(50) NULL,
	xgaponpnl decimal(10, 2) NULL,
	ygaponpnl decimal(10, 2) NULL,
	wrapcheckweight bit NULL,
	boxcheckweight bit NULL
);


CREATE TABLE if not exists public.p_ecn (
	recid int NOT NULL,
	approvestatus text NULL,
	approveversion int NULL,
	contents varchar(1000) NULL,
	createdate timestamp NULL,
	delivery1 date NULL,
	delivery2 date NULL,
	delivery3 date NULL,
	delivery4 date NULL,
	delivery5 date NULL,
	desdelivery date NULL,
	desquantity int NULL,
	ecnnumber varchar(50) NULL,
	ecntype text NULL,
	enableapproval bit NULL,
	ifcancel bit NULL,
	ifdelivery bit NULL,
	ifmi bit NULL,
	ifonhold bit NULL,
	ifonline bit NULL,
	ifpayfor bit NULL,
	ifquantity bit NULL,
	ifsplitdelivery bit NULL,
	ifstock bit NULL,
	iftool bit NULL,
	michangetype varchar(50) NULL,
	michanges varchar(200) NULL,
	midate date NULL,
	minotes text NULL,
	newpartname varchar(100) NULL,
	newpartnum varchar(50) NULL,
	newpartrev varchar(50) NULL,
	newsalespartname varchar(100) NULL,
	newsalespartnum varchar(50) NULL,
	newsalespartrev varchar(50) NULL,
	notes text NULL,
	ocnchanges varchar(200) NULL,
	ocndate date NULL,
	onlinechanges varchar(200) NULL,
	onlinedate date NULL,
	onlinenotes text NULL,
	orderprice numeric(20, 4) NULL,
	oridelivery date NULL,
	oriquantity int NULL,
	originalstatus varchar(50) NULL,
	payforamount numeric(20, 4) NULL,
	payforchanges varchar(200) NULL,
	payfordate date NULL,
	payfornotes text NULL,
	payforreasons text NULL,
	pdid varchar(100) NULL,
	piid varchar(100) NULL,
	quantity1 int NULL,
	quantity2 int NULL,
	quantity3 int NULL,
	quantity4 int NULL,
	quantity5 int NULL,
	reasons text NULL,
	"status" varchar(50) NULL,
	stockchanges varchar(200) NULL,
	stockdate date NULL,
	stocknotes text NULL,
	subject varchar(200) NULL,
	toolchanges varchar(200) NULL,
	tooldate date NULL,
	toolnotes text NULL,
	"type" text NULL,
	"uuid" varchar(50) NULL,
	"version" int NULL,
	companyid int NULL,
	contractsoid int NULL,
	creatorid int NULL,
	customerid int NULL,
	departmentid int NULL,
	flowtypeid int NULL,
	jobid int NULL,
	miuserid int NULL,
	ocnuserid int NULL,
	onlineuserid int NULL,
	payforuserid int NULL,
	postroleid int NULL,
	salespartsid int NULL,
	stockuserid int NULL,
	tooluserid int NULL,
	ocnchangetype varchar(50) NULL,
	ifupdaterev bit NULL,
	ifoldrevsend bit NULL,
	orderoldprice numeric(20, 4) NULL,
	actionstatus varchar(30) NULL,
	newjobid int NULL,
	newsalespartid int NULL,
	oldrevdo varchar(20) NULL,
	oldrevnote varchar(100) NULL,
	infotype varchar(300) NULL,
	changeproject varchar(300) NULL,
	miidea varchar(100) NULL,
	instructions text NULL,
	qtyonline int NULL,
	qtystock int NULL,
	xout int NULL,
	actiondate date NULL,
	changegrade varchar(300) NULL,
	mfg varchar(30) NULL,
	mfgnotes text NULL,
	mfgdate date NULL,
	mfguserid int NULL,
	qc varchar(30) NULL,
	qcnotes text NULL,
	qcdate date NULL,
	qcuserid int NULL,
	pmc varchar(30) NULL,
	pmcnotes text NULL,
	pmcdate date NULL,
	pmcuserid int NULL,
	sop varchar(200) NULL,
	cp varchar(200) NULL,
	tecnotes text NULL,
	tecdate date NULL,
	tecuserid int NULL,
	fmea varchar(200) NULL,
	onholdwologs text NULL,
	newcustomerid int NULL,
	newtype varchar(30) NULL,
	custmatcode varchar(100) NULL,
	importdata bit NULL,
	actiondone bit NULL,
	productgroupid int NULL,
	newproductgroupid int NULL,
	xnh_sourceid varchar(50) NULL,
	effectivemethod text NULL,
	issampletobatch bit NULL,
	shippinglabelrequirements text NULL,
	detailsbeforechange text NULL,
	detailsafterchange text NULL,
	deductionid int NULL,
	newpartflag varchar(50) NULL,
	responsibleperson text NULL,
	batchnumber text NULL,
	batchlock int NULL,
	iscreateprequalify int NULL,
	prequalifyid int NULL,
	suspendbalances varchar(200) NULL,
	pauseremark varchar(200) NULL,
	numberofonline varchar(200) NULL,
	changenumberofonline varchar(200) NULL,
	ecnnauditnottoolissued bit NULL,
	addresschange varchar(200) NULL,
	applicability varchar(200) NULL,
	processids varchar(200) NULL,
	processchanged int NULL,
	filechanged_fmea bit NULL,
	filechanged_cp bit NULL,
	filechanged_sop bit NULL,
	filechanged_drawing bit NULL,
	filechanged_route bit NULL,
	filechanged_bom bit NULL,
	mfgpartid int NULL,
	mfgpartcode varchar(200) NULL,
	startprocessid int NULL,
	startprocessname varchar(200) NULL,
	oldsurface varchar(200) NULL,
	newsurface varchar(200) NULL,
	newcurrencyid int NULL,
	newcurrencyname varchar(200) NULL,
	oastate varchar(100) NULL,
	doprocessnote bit NULL,
	doqualitynote bit NULL,
	importmethod varchar(50) NULL,
	botifycustomers varchar(50) NULL,
	reasonexplanation varchar(50) NULL,
	authentications varchar(50) NULL,
	propertychange varchar(50) NULL,
	customerrequirement varchar(50) NULL,
	materialchange varchar(50) NULL,
	shipmentstatus varchar(50) NULL,
	donotcreateecn bit NOT NULL,
	involveddepartments varchar(50) NULL,
	standardrequirements varchar(50) NULL,
	processimpact varchar(50) NULL,
	productimpact varchar(50) NULL,
	costandefficiency varchar(50) NULL,
	confirmby int NULL,
	confirmdate timestamp NULL,
	confirmtype varchar(50) NULL,
	qualityproductimpact varchar(50) NULL
);
