-------------------------------------------------------------------
-- EAI 세팅
-- DROP SEQUENCE eai.revision_info_seq;
CREATE SEQUENCE eai.revision_info_seq
	INCREMENT BY 1
	MINVALUE 1
	MAXVALUE 9223372036854775807
	START 1
	CACHE 1
	NO CYCLE;
	
CREATE TABLE eai.REVINFO (
    REV BIGINT,
    REVTSTMP BIGINT,
    USERID VARCHAR(40),
    CONSTRAINT revinfo_pkey PRIMARY KEY (REV)
);

CREATE TABLE eai.tseaiad01_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    adptrbzwkgroupname varchar(50) NOT NULL,
	adptrmsgptrncd bpchar(1) NULL,
	eaibzwkdstcd varchar(4) NULL,
	adptrcd bpchar(3) NULL,
	adptrmsgdstcd bpchar(3) NULL,
	adptriodstcd bpchar(1) NULL,
	refclsname varchar(100) NULL,
	sndrcvhmslogyn bpchar(1) NULL,
	adptruseyn bpchar(1) NULL,
	spcfcluuseyn bpchar(1) NULL,
	adptrbzwkgroupdesc varchar(200) NULL,
	osidinstino bpchar(12) NULL,
	eaisevrdstcd bpchar(1) NULL,
	eailastamndyms bpchar(17) NULL,
	osidinstiyn bpchar(1) NULL,
	osidinstibzwkrsempname varchar(60) NULL,
	osidinstitelno bpchar(50) NULL,
	moniuseyn bpchar(1) NULL,
	monicndnctnt varchar(30) NULL,
	kesauseyn varchar(1) NULL,
	testmasteryn varchar(1) NULL,
	adptrnickname varchar(50) NULL,
	companycodedata varchar(20) NULL,
	adptrinsticode varchar(20) NULL,
	cirnumber varchar(100) NULL,
	dradptryn bpchar(1) NULL,
	bidinterface varchar(30) NULL,
	msgencode varchar(20) NULL,
	loadbalancingtype varchar(255) NULL,
	linkedadaptergroup varchar(50) NULL,
	samesessionyn varchar(1) NULL,
	pairadapteryn varchar(1) NULL,
	CONSTRAINT tseaiad01_aud_pkey PRIMARY KEY (adptrbzwkgroupname, REV)
);

CREATE TABLE eai.tseaiad02_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    adptrbzwkgroupname varchar(50) NOT NULL,
	adptrbzwkname varchar(50) NOT NULL,
	eaisevrinstncname varchar(300) NULL,
	lstnerclsname varchar(100) NULL,
	testclsname varchar(100) NULL,
	prptygroupname varchar(50) NULL,
	adptrdesc varchar(200) NULL,
	CONSTRAINT tseaiad02_aud_pkey PRIMARY KEY (adptrbzwkgroupname, adptrbzwkname, REV)
);

CREATE TABLE eai.tseaiad14_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    prptygroupname varchar(50) NOT NULL,
	prptygroupdesc varchar(200) NULL,
	CONSTRAINT tseaiad14_aud_pkey PRIMARY KEY (prptygroupname, REV)
);

CREATE TABLE eai.tseaiad15_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    prptygroupname varchar(50) NOT NULL,
	prptyname varchar(100) NOT NULL,
	prpty2val varchar(2000) NULL,
	prptygroupdesc varchar(200) NULL,
	CONSTRAINT tseaiad15_aud_pkey PRIMARY KEY (prptygroupname, prptyname, REV)
);

-------------------------------------------------------------------
-- FEP 세팅
-- DROP SEQUENCE fep.revision_info_seq;
CREATE SEQUENCE fep.revision_info_seq
	INCREMENT BY 1
	MINVALUE 1
	MAXVALUE 9223372036854775807
	START 1
	CACHE 1
	NO CYCLE;
	
CREATE TABLE REVINFO (
    REV BIGINT,
    REVTSTMP BIGINT,
    USERID VARCHAR(40),
    CONSTRAINT revinfo_pkey PRIMARY KEY (REV)
);

CREATE TABLE fep.tseaiad01_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    adptrbzwkgroupname varchar(50) NOT NULL,
	adptrmsgptrncd bpchar(1) NULL,
	eaibzwkdstcd varchar(4) NULL,
	adptrcd bpchar(3) NULL,
	adptrmsgdstcd bpchar(3) NULL,
	adptriodstcd bpchar(1) NULL,
	refclsname varchar(100) NULL,
	sndrcvhmslogyn bpchar(1) NULL,
	adptruseyn bpchar(1) NULL,
	spcfcluuseyn bpchar(1) NULL,
	adptrbzwkgroupdesc varchar(200) NULL,
	osidinstino bpchar(12) NULL,
	eaisevrdstcd bpchar(1) NULL,
	eailastamndyms bpchar(17) NULL,
	osidinstiyn bpchar(1) NULL,
	osidinstibzwkrsempname varchar(60) NULL,
	osidinstitelno bpchar(50) NULL,
	moniuseyn bpchar(1) NULL,
	monicndnctnt varchar(30) NULL,
	kesauseyn varchar(1) NULL,
	testmasteryn varchar(1) NULL,
	adptrnickname varchar(50) NULL,
	companycodedata varchar(20) NULL,
	adptrinsticode varchar(20) NULL,
	cirnumber varchar(100) NULL,
	dradptryn bpchar(1) NULL,
	bidinterface varchar(30) NULL,
	msgencode varchar(20) NULL,
	loadbalancingtype varchar(255) NULL,
	linkedadaptergroup varchar(50) NULL,
	samesessionyn varchar(1) NULL,
	pairadapteryn varchar(1) NULL,
	CONSTRAINT tseaiad01_aud_pkey PRIMARY KEY (adptrbzwkgroupname, REV)
);

CREATE TABLE fep.tseaiad02_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    adptrbzwkgroupname varchar(50) NOT NULL,
	adptrbzwkname varchar(50) NOT NULL,
	eaisevrinstncname varchar(300) NULL,
	lstnerclsname varchar(100) NULL,
	testclsname varchar(100) NULL,
	prptygroupname varchar(50) NULL,
	adptrdesc varchar(200) NULL,
	CONSTRAINT tseaiad02_aud_pkey PRIMARY KEY (adptrbzwkgroupname, adptrbzwkname, REV)
);

CREATE TABLE fep.tseaiad14_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    prptygroupname varchar(50) NOT NULL,
	prptygroupdesc varchar(200) NULL,
	CONSTRAINT tseaiad14_aud_pkey PRIMARY KEY (prptygroupname, REV)
);

CREATE TABLE fep.tseaiad15_AUD (
	REV INT NOT NULL,
    REVTYPE SMALLINT,
    prptygroupname varchar(50) NOT NULL,
	prptyname varchar(100) NOT NULL,
	prpty2val varchar(2000) NULL,
	prptygroupdesc varchar(200) NULL,
	CONSTRAINT tseaiad15_aud_pkey PRIMARY KEY (prptygroupname, prptyname, REV)
);

-- RMS 메뉴 세팅
INSERT INTO ems.tseairm01 (menuid, parentmenuid, sortorder, menuname, menuurl, menuimage, displayyn, useyn, apppath, appcode) 
VALUES('0502030', '0502000', 20, '어댑터 변경이력', '/monitoring/onl/admin/adapter/adapterAuditMan.view', '', 'Y', 'Y', '', 'ONL');
INSERT INTO ems.tseairm03 (roleid, menuid, auth) VALUES('admin', '0502030', 'W');


