
/* Drop Indexes */

DROP INDEX IF EXISTS comtccmmncode_i01;
DROP INDEX IF EXISTS comtccmmndetailcode_i01;
DROP INDEX IF EXISTS comthemplyrinfochangedtls_i01;
DROP INDEX IF EXISTS comthprogrmchangedtls_i01;
DROP INDEX IF EXISTS comtnauthorrolerelate_i01;
DROP INDEX IF EXISTS comtnauthorrolerelate_i02;
DROP INDEX IF EXISTS comtnbbs_i01;
DROP INDEX IF EXISTS comtnbbsuse_i01;
DROP INDEX IF EXISTS comtncomment_i01;
DROP INDEX IF EXISTS comtnemplyrinfo_i01;
DROP INDEX IF EXISTS comtnemplyrinfo_i02;
DROP INDEX IF EXISTS comtnemplyrscrtyestbs_i04;
DROP INDEX IF EXISTS comtnentrprsmber_i01;
DROP INDEX IF EXISTS comtnfiledetail_i01;
DROP INDEX IF EXISTS comtngnrlmber_i01;
DROP INDEX IF EXISTS comtnmenucreatdtls_i02;
DROP INDEX IF EXISTS comtnmenucreatdtls_i03;
DROP INDEX IF EXISTS comtnmenucreatdtls_i04;
DROP INDEX IF EXISTS comtnmenuinfo_i02;
DROP INDEX IF EXISTS comtnroles_hierarchy_i02;



/* Drop Views */

DROP VIEW IF EXISTS public.comvnusermaster;



/* Drop Tables */





/* Create Tables */

-- 공통분류코드
CREATE TABLE public.comtccmmnclcode
(
	-- 분류코드
	cl_code char(3) NOT NULL,
	-- 분류코드명
	cl_code_nm varchar(60),
	-- 분류코드설명
	cl_code_dc varchar(200),
	-- 사용여부
	use_at char,
	-- 최초등록시점
	frst_regist_pnttm timestamp,
	-- 최초등록자ID
	frst_register_id varchar(20),
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	CONSTRAINT comtccmmnclcode_pkey PRIMARY KEY (cl_code)
) WITHOUT OIDS;


-- 공통코드
CREATE TABLE public.comtccmmncode
(
	-- 코드ID
	code_id varchar(6) NOT NULL,
	-- 코드ID명
	code_id_nm varchar(60),
	-- 코드ID설명
	code_id_dc varchar(200),
	-- 사용여부
	use_at char,
	-- 분류코드
	cl_code char(3),
	-- 최초등록시점
	frst_regist_pnttm timestamp,
	-- 최초등록자ID
	frst_register_id varchar(20),
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	CONSTRAINT comtccmmncode_pkey PRIMARY KEY (code_id)
) WITHOUT OIDS;


-- 공통상세코드
CREATE TABLE public.comtccmmndetailcode
(
	-- 코드ID
	code_id varchar(6) NOT NULL,
	-- 코드
	code varchar(15) NOT NULL,
	-- 코드명
	code_nm varchar(60),
	-- 코드설명
	code_dc varchar(200),
	-- 사용여부
	use_at char,
	-- 최초등록시점
	frst_regist_pnttm timestamp,
	-- 최초등록자ID
	frst_register_id varchar(20),
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	CONSTRAINT comtccmmndetailcode_pkey PRIMARY KEY (code_id, code)
) WITHOUT OIDS;


-- 시퀀스저장
CREATE TABLE public.comtecopseq
(
	-- 테이블명
	table_name varchar(20) NOT NULL,
	-- 다음아이디
	next_id numeric(30),
	CONSTRAINT comtecopseq_pkey PRIMARY KEY (table_name)
) WITHOUT OIDS;


-- 업무사용자정보변경내역
CREATE TABLE public.comthemplyrinfochangedtls
(
	-- 업무사용자ID
	emplyr_id varchar(20) NOT NULL,
	-- 변경일
	change_de char(20) NOT NULL,
	-- 조직ID
	orgnzt_id char(20),
	-- 그룹ID
	group_id char(20),
	-- 사원번호
	empl_no varchar(20),
	-- 성별코드
	sexdstn_code char,
	-- 생일
	brthdy char(20),
	-- 팩스번호
	fxnum varchar(20),
	-- 주택주소
	house_adres varchar(100),
	-- 주택끝전화번호
	house_end_telno varchar(4),
	-- 지역번호
	area_no varchar(4),
	-- 상세주소
	detail_adres varchar(100),
	-- 우편번호
	zip varchar(6),
	-- 사무실전화번호
	offm_telno varchar(20),
	-- 이동전화번호
	mbtlnum varchar(20),
	-- 이메일주소
	email_adres varchar(50),
	-- 주택중간전화번호
	house_middle_telno varchar(4),
	-- 소속기관코드
	pstinst_code char(8),
	-- 사용자상태코드
	emplyr_sttus_code char,
	-- 고유ID
	esntl_id char(20),
	CONSTRAINT comthemplyrinfochangedtls_pkey PRIMARY KEY (emplyr_id, change_de)
) WITHOUT OIDS;


-- 프로그램변경내역
CREATE TABLE public.comthprogrmchangedtls
(
	-- 프로그램파일명
	progrm_file_nm varchar(60) NOT NULL,
	-- 요청번호
	requst_no numeric(10) NOT NULL,
	-- 요청자ID
	rqester_id varchar(20) NOT NULL,
	-- 변경요청내용
	change_requst_cn varchar(1000),
	-- 요청처리내용
	requst_process_cn text,
	-- 처리자ID
	opetr_id varchar(20),
	-- 처리상태코드
	process_sttus_code varchar(15) NOT NULL,
	-- 처리일
	process_de char(20),
	-- 요청일
	rqestde char(20),
	-- 요청제목
	requst_sj varchar(60) NOT NULL,
	CONSTRAINT comthprogrmchangedtls_pkey PRIMARY KEY (progrm_file_nm, requst_no)
) WITHOUT OIDS;


-- 권한그룹정보
CREATE TABLE public.comtnauthorgroupinfo
(
	-- 그룹ID
	group_id char(20) NOT NULL,
	-- 그룹명
	group_nm varchar(60) NOT NULL,
	-- 그룹생성일
	group_creat_de timestamp NOT NULL,
	-- 그룹설명
	group_dc varchar(100),
	CONSTRAINT comtnauthorgroupinfo_pkey PRIMARY KEY (group_id)
) WITHOUT OIDS;


-- 권한정보
CREATE TABLE public.comtnauthorinfo
(
	-- 권한코드
	author_code varchar(30) NOT NULL,
	-- 권한명
	author_nm varchar(60) NOT NULL,
	-- 권한설명
	author_dc varchar(200),
	-- 권한생성일
	author_creat_de timestamp NOT NULL,
	CONSTRAINT comtnauthorinfo_pkey PRIMARY KEY (author_code)
) WITHOUT OIDS;


-- 권한롤관계
CREATE TABLE public.comtnauthorrolerelate
(
	-- 권한코드
	author_code varchar(30) NOT NULL,
	-- 롤코드
	role_code varchar(50) NOT NULL,
	-- 생성일시
	creat_dt timestamp,
	CONSTRAINT comtnauthorrolerelate_pkey PRIMARY KEY (author_code, role_code)
) WITHOUT OIDS;


-- 게시판
CREATE TABLE public.comtnbbs
(
	-- 게시물ID
	ntt_id numeric(20) NOT NULL,
	-- 게시판ID
	bbs_id char(20) NOT NULL,
	-- 게시물번호
	ntt_no numeric(20),
	-- 게시물제목
	ntt_sj varchar(2000),
	-- 게시물내용
	ntt_cn text,
	-- 댓글여부
	answer_at char,
	-- 부모글번호
	parntsctt_no numeric(10),
	-- 댓글위치
	answer_lc numeric(8),
	-- 정렬순서
	sort_ordr numeric(8),
	-- 조회수
	rdcnt numeric(10),
	-- 사용여부
	use_at char NOT NULL,
	-- 게시시작일
	ntce_bgnde char(20),
	-- 게시종료일
	ntce_endde char(20),
	-- 게시자ID
	ntcr_id varchar(20),
	-- 게시자명
	ntcr_nm varchar(20),
	-- 비밀번호
	password varchar(200),
	-- 첨부파일ID
	atch_file_id char(20),
	-- 공지사항여부
	notice_at char,
	-- 제목볼드여부
	sj_bold_at char,
	-- 비밀글여부
	secret_at char,
	-- 최초등록시점
	frst_regist_pnttm timestamp NOT NULL,
	-- 최초등록자ID
	frst_register_id varchar(20) NOT NULL,
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	-- 블로그 ID
	blog_id char(20),
	CONSTRAINT comtnbbs_pkey PRIMARY KEY (ntt_id, bbs_id)
) WITHOUT OIDS;


-- 게시판마스터
CREATE TABLE public.comtnbbsmaster
(
	-- 게시판ID
	bbs_id char(20) NOT NULL,
	-- 게시판명
	bbs_nm varchar(255) NOT NULL,
	-- 게시판소개
	bbs_intrcn varchar(2400),
	-- 게시판유형코드
	bbs_ty_code char(6) NOT NULL,
	-- 답장가능여부
	reply_posbl_at char,
	-- 파일첨부가능여부
	file_atch_posbl_at char NOT NULL,
	-- 첨부가능파일숫자
	atch_posbl_file_number numeric(2) NOT NULL,
	-- 첨부가능파일사이즈
	atch_posbl_file_size numeric(8),
	-- 사용여부
	use_at char NOT NULL,
	-- 템플릿ID
	tmplat_id char(20),
	-- 커뮤니티ID
	cmmnty_id char(20),
	-- 최초등록자ID
	frst_register_id varchar(20) NOT NULL,
	-- 최초등록시점
	frst_regist_pnttm timestamp NOT NULL,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 블로그 ID
	blog_id char(20),
	-- 블로그 여부
	blog_at char(2),
	CONSTRAINT comtnbbsmaster_pkey PRIMARY KEY (bbs_id)
) WITHOUT OIDS;


-- 게시판마스터옵션
CREATE TABLE public.comtnbbsmasteroptn
(
	-- 게시판ID
	bbs_id char(20) NOT NULL,
	-- 댓글여부
	answer_at char NOT NULL,
	-- 만족도여부
	stsfdg_at char NOT NULL,
	-- 최초등록시점
	frst_regist_pnttm timestamp NOT NULL,
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 최초등록자ID
	frst_register_id varchar(20) NOT NULL,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	CONSTRAINT comtnbbsmasteroptn_pkey PRIMARY KEY (bbs_id)
) WITHOUT OIDS;


-- 게시판활용
CREATE TABLE public.comtnbbsuse
(
	-- 게시판ID
	bbs_id char(20) NOT NULL,
	-- 대상ID
	trget_id char(20) NOT NULL,
	-- 사용여부
	use_at char NOT NULL,
	-- 등록구분코드
	regist_se_code char(6),
	-- 최초등록시점
	frst_regist_pnttm timestamp,
	-- 최초등록자ID
	frst_register_id varchar(20) NOT NULL,
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	CONSTRAINT comtnbbsuse_pkey PRIMARY KEY (bbs_id, trget_id)
) WITHOUT OIDS;


-- 바로가기 메뉴 등록
CREATE TABLE public.comtnbkmkmenumanageresult
(
	-- 메뉴ID
	menu_id numeric(20) NOT NULL,
	-- 업무사용자ID
	emplyr_id varchar(20) NOT NULL,
	-- 메뉴명
	menu_nm varchar(60) NOT NULL,
	-- 프로그램저장경로
	progrm_stre_path varchar(100) NOT NULL,
	CONSTRAINT comtnbkmkmenumanageresult_pkey PRIMARY KEY (menu_id, emplyr_id)
) WITHOUT OIDS;


-- 댓글
CREATE TABLE public.comtncomment
(
	-- 게시물ID
	ntt_id numeric(20) NOT NULL,
	-- 게시판ID
	bbs_id char(20) NOT NULL,
	-- 댓글번호
	answer_no numeric(20) NOT NULL,
	-- 작성자ID
	wrter_id varchar(20),
	-- 작성자명
	wrter_nm varchar(20),
	-- 댓글
	answer varchar(200),
	-- 사용여부
	use_at char NOT NULL,
	-- 최초등록시점
	frst_regist_pnttm timestamp NOT NULL,
	-- 최초등록자ID
	frst_register_id varchar(20) NOT NULL,
	-- 최종수정시점
	last_updt_pnttm timestamp,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	-- 비밀번호
	password varchar(200),
	CONSTRAINT comtncomment_pkey PRIMARY KEY (ntt_id, bbs_id, answer_no)
) WITHOUT OIDS;


-- 업무사용자정보
CREATE TABLE public.comtnemplyrinfo
(
	-- 업무사용자ID
	emplyr_id varchar(20) NOT NULL,
	-- 조직ID
	orgnzt_id char(20),
	-- 사용자명
	user_nm varchar(60) NOT NULL,
	-- 비밀번호
	password varchar(200) NOT NULL,
	-- 사원번호
	empl_no varchar(20),
	-- 주민등록번호
	ihidnum varchar(200),
	-- 성별코드
	sexdstn_code char,
	-- 생일
	brthdy char(20),
	-- 팩스번호
	fxnum varchar(20),
	-- 주택주소
	house_adres varchar(100) NOT NULL,
	-- 비밀번호힌트
	password_hint varchar(100) NOT NULL,
	-- 비밀번호정답
	password_cnsr varchar(100) NOT NULL,
	-- 주택끝전화번호
	house_end_telno varchar(4) NOT NULL,
	-- 지역번호
	area_no varchar(4) NOT NULL,
	-- 상세주소
	detail_adres varchar(100),
	-- 우편번호
	zip varchar(6) NOT NULL,
	-- 사무실전화번호
	offm_telno varchar(20),
	-- 이동전화번호
	mbtlnum varchar(20),
	-- 이메일주소
	email_adres varchar(50),
	-- 직위명
	ofcps_nm varchar(60),
	-- 주택중간전화번호
	house_middle_telno varchar(4) NOT NULL,
	-- 그룹ID
	group_id char(20),
	-- 소속기관코드
	pstinst_code char(8),
	-- 사용자상태코드
	emplyr_sttus_code char NOT NULL,
	-- 고유ID
	esntl_id char(20) NOT NULL,
	-- 인증DN값
	crtfc_dn_value varchar(100),
	-- 가입일자
	sbscrb_de timestamp,
	-- 잠금여부
	lock_at char,
	-- 잠금회수
	lock_cnt numeric(3),
	-- 잠금최종시점
	lock_last_pnttm timestamp,
	chg_pwd_last_pnttm timestamp,
	CONSTRAINT comtnemplyrinfo_pkey PRIMARY KEY (emplyr_id)
) WITHOUT OIDS;


-- 사용자보안설정
CREATE TABLE public.comtnemplyrscrtyestbs
(
	-- 보안설정대상ID
	scrty_dtrmn_trget_id varchar(20) NOT NULL,
	-- 회원유형코드
	mber_ty_code char(5),
	-- 권한코드
	author_code varchar(30) NOT NULL,
	CONSTRAINT comtnemplyrscrtyestbs_pkey PRIMARY KEY (scrty_dtrmn_trget_id)
) WITHOUT OIDS;


-- 기업회원
CREATE TABLE public.comtnentrprsmber
(
	-- 기업회원ID
	entrprs_mber_id varchar(20) NOT NULL,
	-- 기업구분코드
	entrprs_se_code char(8),
	-- 사업자등록번호
	bizrno varchar(10),
	-- 법인등록번호
	jurirno varchar(13),
	-- 회사명
	cmpny_nm varchar(60) NOT NULL,
	-- 대표이사
	cxfc varchar(50),
	-- 우편번호
	zip varchar(6) NOT NULL,
	-- 주소
	adres varchar(100) NOT NULL,
	-- 기업중간전화번호
	entrprs_middle_telno varchar(4) NOT NULL,
	-- 팩스번호
	fxnum varchar(20),
	-- 업종코드
	induty_code char,
	-- 신청인명
	applcnt_nm varchar(50) NOT NULL,
	-- 신청인주민등록번호
	applcnt_ihidnum varchar(200),
	-- 가입일자
	sbscrb_de timestamp,
	-- 기업회원상태
	entrprs_mber_sttus varchar(15),
	-- 기업회원비밀번호
	entrprs_mber_password varchar(200),
	-- 기업회원비밀번호힌트
	entrprs_mber_password_hint varchar(100) NOT NULL,
	-- 기업회원비밀번호정답
	entrprs_mber_password_cnsr varchar(100) NOT NULL,
	-- 그룹ID
	group_id char(20),
	-- 상세주소
	detail_adres varchar(100),
	-- 기업끝전화번호
	entrprs_end_telno varchar(4) NOT NULL,
	-- 지역번호
	area_no varchar(4) NOT NULL,
	-- 신청자이메일주소
	applcnt_email_adres varchar(50) NOT NULL,
	-- 고유ID
	esntl_id char(20) NOT NULL,
	-- 잠금여부
	lock_at char,
	-- 잠금회수
	lock_cnt numeric(3),
	-- 잠금최종시점
	lock_last_pnttm timestamp,
	chg_pwd_last_pnttm timestamp,
	CONSTRAINT comtnentrprsmber_pkey PRIMARY KEY (entrprs_mber_id)
) WITHOUT OIDS;


-- 파일속성
CREATE TABLE public.comtnfile
(
	-- 첨부파일ID
	atch_file_id char(20) NOT NULL,
	-- 생성일시
	creat_dt timestamp NOT NULL,
	-- 사용여부
	use_at char,
	CONSTRAINT comtnfile_pkey PRIMARY KEY (atch_file_id)
) WITHOUT OIDS;


-- 파일상세정보
CREATE TABLE public.comtnfiledetail
(
	-- 첨부파일ID
	atch_file_id char(20) NOT NULL,
	-- 파일순번
	file_sn numeric(10) NOT NULL,
	-- 파일저장경로
	file_stre_cours varchar(2000) NOT NULL,
	-- 저장파일명
	stre_file_nm varchar(255) NOT NULL,
	-- 원파일명
	orignl_file_nm varchar(255),
	-- 파일확장자
	file_extsn varchar(20) NOT NULL,
	-- 파일내용
	file_cn text,
	-- 파일크기
	file_size numeric(8),
	CONSTRAINT comtnfiledetail_pkey PRIMARY KEY (atch_file_id, file_sn)
) WITHOUT OIDS;


-- 일반회원
CREATE TABLE public.comtngnrlmber
(
	-- 회원ID
	mber_id varchar(20) NOT NULL,
	-- 비밀번호
	password varchar(200) NOT NULL,
	-- 비밀번호힌트
	password_hint varchar(100),
	-- 비밀번호정답
	password_cnsr varchar(100),
	-- 주민등록번호
	ihidnum varchar(200),
	-- 회원명
	mber_nm varchar(50) NOT NULL,
	-- 우편번호
	zip varchar(6) NOT NULL,
	-- 주소
	adres varchar(100) NOT NULL,
	-- 지역번호
	area_no varchar(4) NOT NULL,
	-- 회원상태
	mber_sttus varchar(15),
	-- 상세주소
	detail_adres varchar(100),
	-- 끝전화번호
	end_telno varchar(4) NOT NULL,
	-- 이동전화번호
	mbtlnum varchar(20) NOT NULL,
	-- 그룹ID
	group_id char(20),
	-- 회원팩스번호
	mber_fxnum varchar(20),
	-- 회원이메일주소
	mber_email_adres varchar(50),
	-- 중간전화번호
	middle_telno varchar(4) NOT NULL,
	-- 가입일자
	sbscrb_de timestamp,
	-- 성별코드
	sexdstn_code char,
	-- 고유ID
	esntl_id char(20) NOT NULL,
	-- 잠금여부
	lock_at char,
	-- 잠금회수
	lock_cnt numeric(3),
	-- 잠금최종시점
	lock_last_pnttm timestamp,
	chg_pwd_last_pnttm timestamp,
	CONSTRAINT comtngnrlmber_pkey PRIMARY KEY (mber_id)
) WITHOUT OIDS;


-- 접속로그
CREATE TABLE public.comtnloginlog
(
	-- 로그ID
	log_id char(20) NOT NULL,
	-- 접속ID
	conect_id varchar(20),
	-- 접속IP
	conect_ip varchar(23),
	-- 접속방식
	conect_mthd char(4),
	-- 오류발생여부
	error_occrrnc_at char,
	-- 오류코드
	error_code char(3),
	-- 생성일시
	creat_dt timestamp,
	CONSTRAINT comtnloginlog_pkey PRIMARY KEY (log_id)
) WITHOUT OIDS;


-- 로그인정책
CREATE TABLE public.comtnloginpolicy
(
	-- 업무사용자ID
	emplyr_id varchar(20) NOT NULL,
	-- IP정보
	ip_info varchar(23) NOT NULL,
	-- 중복허용여부
	dplct_perm_at char NOT NULL,
	-- 제한여부
	lmtt_at char NOT NULL,
	-- 최초등록자ID
	frst_register_id varchar(20),
	-- 최초등록시점
	frst_regist_pnttm timestamp,
	-- 최종수정자ID
	last_updusr_id varchar(20),
	-- 최종수정시점
	last_updt_pnttm timestamp,
	CONSTRAINT comtnloginpolicy_pkey PRIMARY KEY (emplyr_id)
) WITHOUT OIDS;


-- 메뉴생성내역
CREATE TABLE public.comtnmenucreatdtls
(
	-- 메뉴번호
	menu_no numeric(20) NOT NULL,
	-- 권한코드
	author_code varchar(30) NOT NULL,
	-- 매핑생성ID
	mapng_creat_id varchar(30),
	CONSTRAINT comtnmenucreatdtls_pkey PRIMARY KEY (menu_no, author_code)
) WITHOUT OIDS;


-- 메뉴정보
CREATE TABLE public.comtnmenuinfo
(
	-- 메뉴명
	menu_nm varchar(60) NOT NULL,
	-- 프로그램파일명
	progrm_file_nm varchar(60) NOT NULL,
	-- 메뉴번호
	menu_no numeric(20) NOT NULL,
	-- 상위메뉴번호
	upper_menu_no numeric(20),
	-- 메뉴순서
	menu_ordr numeric(5) NOT NULL,
	-- 메뉴설명
	menu_dc varchar(250),
	-- 관계이미지경로
	relate_image_path varchar(100),
	-- 관계이미지명
	relate_image_nm varchar(60),
	CONSTRAINT comtnmenuinfo_pkey PRIMARY KEY (menu_no)
) WITHOUT OIDS;


-- 조직정보
CREATE TABLE public.comtnorgnztinfo
(
	-- 조직ID
	orgnzt_id char(20) NOT NULL,
	-- 조직명
	orgnzt_nm varchar(20) NOT NULL,
	-- 조직설명
	orgnzt_dc varchar(100),
	CONSTRAINT comtnorgnztinfo_pkey PRIMARY KEY (orgnzt_id)
) WITHOUT OIDS;


-- 프로그램목록
CREATE TABLE public.comtnprogrmlist
(
	-- 프로그램파일명
	progrm_file_nm varchar(60) NOT NULL,
	-- 프로그램저장경로
	progrm_stre_path varchar(100) NOT NULL,
	-- 프로그램한글명
	progrm_korean_nm varchar(60),
	-- 프로그램설명
	progrm_dc varchar(200),
	-- URL
	url varchar(100) NOT NULL,
	CONSTRAINT comtnprogrmlist_pkey PRIMARY KEY (progrm_file_nm)
) WITHOUT OIDS;


-- 롤정보
CREATE TABLE public.comtnroleinfo
(
	-- 롤코드
	role_code varchar(50) NOT NULL,
	-- 롤명
	role_nm varchar(60) NOT NULL,
	-- 롤패턴
	role_pttrn varchar(300),
	-- 롤설명
	role_dc varchar(200),
	-- 롤유형
	role_ty varchar(80),
	-- 롤정렬
	role_sort varchar(10),
	-- 롤생성일
	role_creat_de timestamp NOT NULL,
	CONSTRAINT comtnroleinfo_pkey PRIMARY KEY (role_code)
) WITHOUT OIDS;


-- 롤 계층구조
CREATE TABLE public.comtnroles_hierarchy
(
	-- 부모롤
	parnts_role varchar(30) NOT NULL UNIQUE,
	-- 자식롤
	chldrn_role varchar(30) NOT NULL,
	CONSTRAINT comtnroles_hierarchy_pkey PRIMARY KEY (parnts_role, chldrn_role)
) WITHOUT OIDS;


-- 사이트맵
CREATE TABLE public.comtnsitemap
(
	-- 매핑생성ID
	mapng_creat_id varchar(30) NOT NULL,
	-- 생성자ID
	creatr_id varchar(20) NOT NULL,
	-- 매핑파일명
	mapng_file_nm varchar(60) NOT NULL,
	-- 매핑파일경로
	mapng_file_path varchar(100) NOT NULL,
	CONSTRAINT comtnsitemap_pkey PRIMARY KEY (mapng_creat_id)
) WITHOUT OIDS;


-- 시스템로그
CREATE TABLE public.comtnsyslog
(
	-- 요청ID
	requst_id varchar(20) NOT NULL,
	-- 업무구분코드
	job_se_code char(3),
	-- 기관코드
	instt_code char(7),
	-- 발생일
	occrrnc_de timestamp,
	-- 요청자IP
	rqester_ip varchar(23),
	-- 요청자ID
	rqester_id varchar(20),
	-- 대상메뉴명
	trget_menu_nm varchar(255),
	-- 서비스명
	svc_nm varchar(255),
	-- 메서드명
	method_nm varchar(60),
	-- 처리구분코드
	process_se_code char(3),
	-- 처리수
	process_co numeric(10),
	-- 처리시간
	process_time varchar(14),
	-- 응답코드
	rspns_code char(3),
	-- 오류구분
	error_se char,
	-- 오류수
	error_co numeric(10),
	-- 오류코드
	error_code char(3),
	CONSTRAINT comtnsyslog_pkey PRIMARY KEY (requst_id)
) WITHOUT OIDS;


-- 웹로그
CREATE TABLE public.comtnweblog
(
	-- 요청ID
	requst_id varchar(20) NOT NULL,
	-- 발생일
	occrrnc_de timestamp,
	-- URL
	url varchar(200),
	-- 요청자ID
	rqester_id varchar(20),
	-- 요청자IP
	rqester_ip varchar(23),
	CONSTRAINT comtnweblog_pkey PRIMARY KEY (requst_id)
) WITHOUT OIDS;


-- 시스템로그요약
CREATE TABLE public.comtssyslogsummary
(
	-- 발생일
	occrrnc_de char(8) NOT NULL,
	-- 서비스명
	svc_nm varchar(255) NOT NULL,
	-- 메서드명
	method_nm varchar(60) NOT NULL,
	-- 생성수
	creat_co numeric(10),
	-- 수정수
	updt_co numeric(10),
	-- 조회수
	rdcnt numeric(10),
	-- 삭제수
	delete_co numeric(10),
	-- 출력수
	outpt_co numeric(10),
	-- 오류수
	error_co numeric(10),
	CONSTRAINT comtssyslogsummary_pkey PRIMARY KEY (occrrnc_de, svc_nm, method_nm)
) WITHOUT OIDS;


-- 웹로그 요약
CREATE TABLE public.comtsweblogsummary
(
	-- 발생일
	occrrnc_de char(8) NOT NULL,
	-- URL
	url varchar(200) NOT NULL,
	-- 조회수
	rdcnt numeric(10),
	CONSTRAINT comtsweblogsummary_pkey PRIMARY KEY (occrrnc_de, url)
) WITHOUT OIDS;


-- 테이블별아이디
CREATE TABLE public.ids
(
	-- IDGEN테이블명
	idgen_table_nm varchar(20) NOT NULL,
	-- IDGEN다음ID
	idgen_next_id numeric(30) NOT NULL,
	CONSTRAINT ids_pkey PRIMARY KEY (idgen_table_nm)
) WITHOUT OIDS;



/* Create Foreign Keys */

ALTER TABLE public.comtccmmncode
	ADD CONSTRAINT comtccmmncode_cl_code_fkey FOREIGN KEY (cl_code)
	REFERENCES public.comtccmmnclcode (cl_code)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comtccmmndetailcode
	ADD CONSTRAINT comtccmmndetailcode_code_id_fkey FOREIGN KEY (code_id)
	REFERENCES public.comtccmmncode (code_id)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comtnemplyrinfo
	ADD CONSTRAINT comtnemplyrinfo_group_id_fkey FOREIGN KEY (group_id)
	REFERENCES public.comtnauthorgroupinfo (group_id)
	ON UPDATE NO ACTION
	ON DELETE SET NULL
;


ALTER TABLE public.comtnentrprsmber
	ADD CONSTRAINT comtnentrprsmber_group_id_fkey FOREIGN KEY (group_id)
	REFERENCES public.comtnauthorgroupinfo (group_id)
	ON UPDATE NO ACTION
	ON DELETE SET NULL
;


ALTER TABLE public.comtngnrlmber
	ADD CONSTRAINT comtngnrlmber_group_id_fkey FOREIGN KEY (group_id)
	REFERENCES public.comtnauthorgroupinfo (group_id)
	ON UPDATE NO ACTION
	ON DELETE SET NULL
;


ALTER TABLE public.comtnauthorrolerelate
	ADD CONSTRAINT comtnauthorrolerelate_author_code_fkey FOREIGN KEY (author_code)
	REFERENCES public.comtnauthorinfo (author_code)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtnmenucreatdtls
	ADD CONSTRAINT comtnmenucreatdtls_author_code_fkey FOREIGN KEY (author_code)
	REFERENCES public.comtnauthorinfo (author_code)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comtnroles_hierarchy
	ADD CONSTRAINT comtnroles_hierarchy_parnts_role_fkey FOREIGN KEY (parnts_role)
	REFERENCES public.comtnauthorinfo (author_code)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtnroles_hierarchy
	ADD CONSTRAINT comtnroles_hierarchy_chldrn_role_fkey FOREIGN KEY (chldrn_role)
	REFERENCES public.comtnauthorinfo (author_code)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtncomment
	ADD CONSTRAINT comtncomment_ntt_id_bbs_id_fkey FOREIGN KEY (ntt_id, bbs_id)
	REFERENCES public.comtnbbs (ntt_id, bbs_id)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comtnbbs
	ADD CONSTRAINT comtnbbs_bbs_id_fkey FOREIGN KEY (bbs_id)
	REFERENCES public.comtnbbsmaster (bbs_id)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comtnbbsuse
	ADD CONSTRAINT comtnbbsuse_bbs_id_fkey FOREIGN KEY (bbs_id)
	REFERENCES public.comtnbbsmaster (bbs_id)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comthemplyrinfochangedtls
	ADD CONSTRAINT comthemplyrinfochangedtls_emplyr_id_fkey FOREIGN KEY (emplyr_id)
	REFERENCES public.comtnemplyrinfo (emplyr_id)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comtnfiledetail
	ADD CONSTRAINT comtnfiledetail_atch_file_id_fkey FOREIGN KEY (atch_file_id)
	REFERENCES public.comtnfile (atch_file_id)
	ON UPDATE NO ACTION
	ON DELETE NO ACTION
;


ALTER TABLE public.comtnmenucreatdtls
	ADD CONSTRAINT comtnmenucreatdtls_menu_no_fkey FOREIGN KEY (menu_no)
	REFERENCES public.comtnmenuinfo (menu_no)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtnmenuinfo
	ADD CONSTRAINT comtnmenuinfo_upper_menu_no_fkey FOREIGN KEY (upper_menu_no)
	REFERENCES public.comtnmenuinfo (menu_no)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtnemplyrinfo
	ADD CONSTRAINT comtnemplyrinfo_orgnzt_id_fkey FOREIGN KEY (orgnzt_id)
	REFERENCES public.comtnorgnztinfo (orgnzt_id)
	ON UPDATE NO ACTION
	ON DELETE SET NULL
;


ALTER TABLE public.comthprogrmchangedtls
	ADD CONSTRAINT comthprogrmchangedtls_progrm_file_nm_fkey FOREIGN KEY (progrm_file_nm)
	REFERENCES public.comtnprogrmlist (progrm_file_nm)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtnmenuinfo
	ADD CONSTRAINT comtnmenuinfo_progrm_file_nm_fkey FOREIGN KEY (progrm_file_nm)
	REFERENCES public.comtnprogrmlist (progrm_file_nm)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtnauthorrolerelate
	ADD CONSTRAINT comtnauthorrolerelate_role_code_fkey FOREIGN KEY (role_code)
	REFERENCES public.comtnroleinfo (role_code)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;


ALTER TABLE public.comtnmenucreatdtls
	ADD CONSTRAINT comtnmenucreatdtls_mapng_creat_id_fkey FOREIGN KEY (mapng_creat_id)
	REFERENCES public.comtnsitemap (mapng_creat_id)
	ON UPDATE NO ACTION
	ON DELETE CASCADE
;



/* Create Views */

-- 사용자정보뷰
CREATE VIEW public.comvnusermaster AS SELECT comtngnrlmber.esntl_id,
    comtngnrlmber.mber_id AS user_id,
    comtngnrlmber.password,
    comtngnrlmber.mber_nm AS user_nm,
    comtngnrlmber.zip AS user_zip,
    comtngnrlmber.adres AS user_adres,
    comtngnrlmber.mber_email_adres AS user_email,
    ' '::bpchar AS group_id,
    'GNR'::text AS user_se,
    ' '::bpchar AS orgnzt_id
   FROM comtngnrlmber
UNION ALL
 SELECT comtnemplyrinfo.esntl_id,
    comtnemplyrinfo.emplyr_id AS user_id,
    comtnemplyrinfo.password,
    comtnemplyrinfo.user_nm,
    comtnemplyrinfo.zip AS user_zip,
    comtnemplyrinfo.house_adres AS user_adres,
    comtnemplyrinfo.email_adres AS user_email,
    comtnemplyrinfo.group_id,
    'USR'::text AS user_se,
    comtnemplyrinfo.orgnzt_id
   FROM comtnemplyrinfo
UNION ALL
 SELECT comtnentrprsmber.esntl_id,
    comtnentrprsmber.entrprs_mber_id AS user_id,
    comtnentrprsmber.entrprs_mber_password AS password,
    comtnentrprsmber.cmpny_nm AS user_nm,
    comtnentrprsmber.zip AS user_zip,
    comtnentrprsmber.adres AS user_adres,
    comtnentrprsmber.applcnt_email_adres AS user_email,
    ' '::bpchar AS group_id,
    'ENT'::text AS user_se,
    ' '::bpchar AS orgnzt_id
   FROM comtnentrprsmber
  ORDER BY 1;



/* Create Indexes */

CREATE INDEX comtccmmncode_i01 ON public.comtccmmncode USING BTREE (cl_code);
CREATE INDEX comtccmmndetailcode_i01 ON public.comtccmmndetailcode USING BTREE (code_id);
CREATE INDEX comthemplyrinfochangedtls_i01 ON public.comthemplyrinfochangedtls USING BTREE (emplyr_id);
CREATE INDEX comthprogrmchangedtls_i01 ON public.comthprogrmchangedtls USING BTREE (progrm_file_nm);
CREATE INDEX comtnauthorrolerelate_i01 ON public.comtnauthorrolerelate USING BTREE (author_code);
CREATE INDEX comtnauthorrolerelate_i02 ON public.comtnauthorrolerelate USING BTREE (role_code);
CREATE INDEX comtnbbs_i01 ON public.comtnbbs USING BTREE (bbs_id);
CREATE INDEX comtnbbsuse_i01 ON public.comtnbbsuse USING BTREE (bbs_id);
CREATE INDEX comtncomment_i01 ON public.comtncomment USING BTREE (ntt_id, bbs_id);
CREATE INDEX comtnemplyrinfo_i01 ON public.comtnemplyrinfo USING BTREE (orgnzt_id);
CREATE INDEX comtnemplyrinfo_i02 ON public.comtnemplyrinfo USING BTREE (group_id);
CREATE INDEX comtnemplyrscrtyestbs_i04 ON public.comtnemplyrscrtyestbs USING BTREE (author_code);
CREATE INDEX comtnentrprsmber_i01 ON public.comtnentrprsmber USING BTREE (group_id);
CREATE INDEX comtnfiledetail_i01 ON public.comtnfiledetail USING BTREE (atch_file_id);
CREATE INDEX comtngnrlmber_i01 ON public.comtngnrlmber USING BTREE (group_id);
CREATE INDEX comtnmenucreatdtls_i02 ON public.comtnmenucreatdtls USING BTREE (menu_no);
CREATE INDEX comtnmenucreatdtls_i03 ON public.comtnmenucreatdtls USING BTREE (mapng_creat_id);
CREATE INDEX comtnmenucreatdtls_i04 ON public.comtnmenucreatdtls USING BTREE (author_code);
CREATE INDEX comtnmenuinfo_i02 ON public.comtnmenuinfo USING BTREE (upper_menu_no);
CREATE INDEX comtnroles_hierarchy_i02 ON public.comtnroles_hierarchy USING BTREE (chldrn_role);



/* Comments */

COMMENT ON TABLE public.comtccmmnclcode IS '공통분류코드';
COMMENT ON COLUMN public.comtccmmnclcode.cl_code IS '분류코드';
COMMENT ON COLUMN public.comtccmmnclcode.cl_code_nm IS '분류코드명';
COMMENT ON COLUMN public.comtccmmnclcode.cl_code_dc IS '분류코드설명';
COMMENT ON COLUMN public.comtccmmnclcode.use_at IS '사용여부';
COMMENT ON COLUMN public.comtccmmnclcode.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtccmmnclcode.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtccmmnclcode.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtccmmnclcode.last_updusr_id IS '최종수정자ID';
COMMENT ON TABLE public.comtccmmncode IS '공통코드';
COMMENT ON COLUMN public.comtccmmncode.code_id IS '코드ID';
COMMENT ON COLUMN public.comtccmmncode.code_id_nm IS '코드ID명';
COMMENT ON COLUMN public.comtccmmncode.code_id_dc IS '코드ID설명';
COMMENT ON COLUMN public.comtccmmncode.use_at IS '사용여부';
COMMENT ON COLUMN public.comtccmmncode.cl_code IS '분류코드';
COMMENT ON COLUMN public.comtccmmncode.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtccmmncode.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtccmmncode.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtccmmncode.last_updusr_id IS '최종수정자ID';
COMMENT ON TABLE public.comtccmmndetailcode IS '공통상세코드';
COMMENT ON COLUMN public.comtccmmndetailcode.code_id IS '코드ID';
COMMENT ON COLUMN public.comtccmmndetailcode.code IS '코드';
COMMENT ON COLUMN public.comtccmmndetailcode.code_nm IS '코드명';
COMMENT ON COLUMN public.comtccmmndetailcode.code_dc IS '코드설명';
COMMENT ON COLUMN public.comtccmmndetailcode.use_at IS '사용여부';
COMMENT ON COLUMN public.comtccmmndetailcode.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtccmmndetailcode.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtccmmndetailcode.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtccmmndetailcode.last_updusr_id IS '최종수정자ID';
COMMENT ON TABLE public.comtecopseq IS '시퀀스저장';
COMMENT ON COLUMN public.comtecopseq.table_name IS '테이블명';
COMMENT ON COLUMN public.comtecopseq.next_id IS '다음아이디';
COMMENT ON TABLE public.comthemplyrinfochangedtls IS '업무사용자정보변경내역';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.emplyr_id IS '업무사용자ID';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.change_de IS '변경일';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.orgnzt_id IS '조직ID';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.group_id IS '그룹ID';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.empl_no IS '사원번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.sexdstn_code IS '성별코드';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.brthdy IS '생일';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.fxnum IS '팩스번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.house_adres IS '주택주소';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.house_end_telno IS '주택끝전화번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.area_no IS '지역번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.detail_adres IS '상세주소';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.zip IS '우편번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.offm_telno IS '사무실전화번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.mbtlnum IS '이동전화번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.email_adres IS '이메일주소';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.house_middle_telno IS '주택중간전화번호';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.pstinst_code IS '소속기관코드';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.emplyr_sttus_code IS '사용자상태코드';
COMMENT ON COLUMN public.comthemplyrinfochangedtls.esntl_id IS '고유ID';
COMMENT ON TABLE public.comthprogrmchangedtls IS '프로그램변경내역';
COMMENT ON COLUMN public.comthprogrmchangedtls.progrm_file_nm IS '프로그램파일명';
COMMENT ON COLUMN public.comthprogrmchangedtls.requst_no IS '요청번호';
COMMENT ON COLUMN public.comthprogrmchangedtls.rqester_id IS '요청자ID';
COMMENT ON COLUMN public.comthprogrmchangedtls.change_requst_cn IS '변경요청내용';
COMMENT ON COLUMN public.comthprogrmchangedtls.requst_process_cn IS '요청처리내용';
COMMENT ON COLUMN public.comthprogrmchangedtls.opetr_id IS '처리자ID';
COMMENT ON COLUMN public.comthprogrmchangedtls.process_sttus_code IS '처리상태코드';
COMMENT ON COLUMN public.comthprogrmchangedtls.process_de IS '처리일';
COMMENT ON COLUMN public.comthprogrmchangedtls.rqestde IS '요청일';
COMMENT ON COLUMN public.comthprogrmchangedtls.requst_sj IS '요청제목';
COMMENT ON TABLE public.comtnauthorgroupinfo IS '권한그룹정보';
COMMENT ON COLUMN public.comtnauthorgroupinfo.group_id IS '그룹ID';
COMMENT ON COLUMN public.comtnauthorgroupinfo.group_nm IS '그룹명';
COMMENT ON COLUMN public.comtnauthorgroupinfo.group_creat_de IS '그룹생성일';
COMMENT ON COLUMN public.comtnauthorgroupinfo.group_dc IS '그룹설명';
COMMENT ON TABLE public.comtnauthorinfo IS '권한정보';
COMMENT ON COLUMN public.comtnauthorinfo.author_code IS '권한코드';
COMMENT ON COLUMN public.comtnauthorinfo.author_nm IS '권한명';
COMMENT ON COLUMN public.comtnauthorinfo.author_dc IS '권한설명';
COMMENT ON COLUMN public.comtnauthorinfo.author_creat_de IS '권한생성일';
COMMENT ON TABLE public.comtnauthorrolerelate IS '권한롤관계';
COMMENT ON COLUMN public.comtnauthorrolerelate.author_code IS '권한코드';
COMMENT ON COLUMN public.comtnauthorrolerelate.role_code IS '롤코드';
COMMENT ON COLUMN public.comtnauthorrolerelate.creat_dt IS '생성일시';
COMMENT ON TABLE public.comtnbbs IS '게시판';
COMMENT ON COLUMN public.comtnbbs.ntt_id IS '게시물ID';
COMMENT ON COLUMN public.comtnbbs.bbs_id IS '게시판ID';
COMMENT ON COLUMN public.comtnbbs.ntt_no IS '게시물번호';
COMMENT ON COLUMN public.comtnbbs.ntt_sj IS '게시물제목';
COMMENT ON COLUMN public.comtnbbs.ntt_cn IS '게시물내용';
COMMENT ON COLUMN public.comtnbbs.answer_at IS '댓글여부';
COMMENT ON COLUMN public.comtnbbs.parntsctt_no IS '부모글번호';
COMMENT ON COLUMN public.comtnbbs.answer_lc IS '댓글위치';
COMMENT ON COLUMN public.comtnbbs.sort_ordr IS '정렬순서';
COMMENT ON COLUMN public.comtnbbs.rdcnt IS '조회수';
COMMENT ON COLUMN public.comtnbbs.use_at IS '사용여부';
COMMENT ON COLUMN public.comtnbbs.ntce_bgnde IS '게시시작일';
COMMENT ON COLUMN public.comtnbbs.ntce_endde IS '게시종료일';
COMMENT ON COLUMN public.comtnbbs.ntcr_id IS '게시자ID';
COMMENT ON COLUMN public.comtnbbs.ntcr_nm IS '게시자명';
COMMENT ON COLUMN public.comtnbbs.password IS '비밀번호';
COMMENT ON COLUMN public.comtnbbs.atch_file_id IS '첨부파일ID';
COMMENT ON COLUMN public.comtnbbs.notice_at IS '공지사항여부';
COMMENT ON COLUMN public.comtnbbs.sj_bold_at IS '제목볼드여부';
COMMENT ON COLUMN public.comtnbbs.secret_at IS '비밀글여부';
COMMENT ON COLUMN public.comtnbbs.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtnbbs.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtnbbs.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtnbbs.last_updusr_id IS '최종수정자ID';
COMMENT ON COLUMN public.comtnbbs.blog_id IS '블로그 ID';
COMMENT ON TABLE public.comtnbbsmaster IS '게시판마스터';
COMMENT ON COLUMN public.comtnbbsmaster.bbs_id IS '게시판ID';
COMMENT ON COLUMN public.comtnbbsmaster.bbs_nm IS '게시판명';
COMMENT ON COLUMN public.comtnbbsmaster.bbs_intrcn IS '게시판소개';
COMMENT ON COLUMN public.comtnbbsmaster.bbs_ty_code IS '게시판유형코드';
COMMENT ON COLUMN public.comtnbbsmaster.reply_posbl_at IS '답장가능여부';
COMMENT ON COLUMN public.comtnbbsmaster.file_atch_posbl_at IS '파일첨부가능여부';
COMMENT ON COLUMN public.comtnbbsmaster.atch_posbl_file_number IS '첨부가능파일숫자';
COMMENT ON COLUMN public.comtnbbsmaster.atch_posbl_file_size IS '첨부가능파일사이즈';
COMMENT ON COLUMN public.comtnbbsmaster.use_at IS '사용여부';
COMMENT ON COLUMN public.comtnbbsmaster.tmplat_id IS '템플릿ID';
COMMENT ON COLUMN public.comtnbbsmaster.cmmnty_id IS '커뮤니티ID';
COMMENT ON COLUMN public.comtnbbsmaster.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtnbbsmaster.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtnbbsmaster.last_updusr_id IS '최종수정자ID';
COMMENT ON COLUMN public.comtnbbsmaster.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtnbbsmaster.blog_id IS '블로그 ID';
COMMENT ON COLUMN public.comtnbbsmaster.blog_at IS '블로그 여부';
COMMENT ON TABLE public.comtnbbsmasteroptn IS '게시판마스터옵션';
COMMENT ON COLUMN public.comtnbbsmasteroptn.bbs_id IS '게시판ID';
COMMENT ON COLUMN public.comtnbbsmasteroptn.answer_at IS '댓글여부';
COMMENT ON COLUMN public.comtnbbsmasteroptn.stsfdg_at IS '만족도여부';
COMMENT ON COLUMN public.comtnbbsmasteroptn.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtnbbsmasteroptn.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtnbbsmasteroptn.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtnbbsmasteroptn.last_updusr_id IS '최종수정자ID';
COMMENT ON TABLE public.comtnbbsuse IS '게시판활용';
COMMENT ON COLUMN public.comtnbbsuse.bbs_id IS '게시판ID';
COMMENT ON COLUMN public.comtnbbsuse.trget_id IS '대상ID';
COMMENT ON COLUMN public.comtnbbsuse.use_at IS '사용여부';
COMMENT ON COLUMN public.comtnbbsuse.regist_se_code IS '등록구분코드';
COMMENT ON COLUMN public.comtnbbsuse.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtnbbsuse.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtnbbsuse.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtnbbsuse.last_updusr_id IS '최종수정자ID';
COMMENT ON TABLE public.comtnbkmkmenumanageresult IS '바로가기 메뉴 등록';
COMMENT ON COLUMN public.comtnbkmkmenumanageresult.menu_id IS '메뉴ID';
COMMENT ON COLUMN public.comtnbkmkmenumanageresult.emplyr_id IS '업무사용자ID';
COMMENT ON COLUMN public.comtnbkmkmenumanageresult.menu_nm IS '메뉴명';
COMMENT ON COLUMN public.comtnbkmkmenumanageresult.progrm_stre_path IS '프로그램저장경로';
COMMENT ON TABLE public.comtncomment IS '댓글';
COMMENT ON COLUMN public.comtncomment.ntt_id IS '게시물ID';
COMMENT ON COLUMN public.comtncomment.bbs_id IS '게시판ID';
COMMENT ON COLUMN public.comtncomment.answer_no IS '댓글번호';
COMMENT ON COLUMN public.comtncomment.wrter_id IS '작성자ID';
COMMENT ON COLUMN public.comtncomment.wrter_nm IS '작성자명';
COMMENT ON COLUMN public.comtncomment.answer IS '댓글';
COMMENT ON COLUMN public.comtncomment.use_at IS '사용여부';
COMMENT ON COLUMN public.comtncomment.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtncomment.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtncomment.last_updt_pnttm IS '최종수정시점';
COMMENT ON COLUMN public.comtncomment.last_updusr_id IS '최종수정자ID';
COMMENT ON COLUMN public.comtncomment.password IS '비밀번호';
COMMENT ON TABLE public.comtnemplyrinfo IS '업무사용자정보';
COMMENT ON COLUMN public.comtnemplyrinfo.emplyr_id IS '업무사용자ID';
COMMENT ON COLUMN public.comtnemplyrinfo.orgnzt_id IS '조직ID';
COMMENT ON COLUMN public.comtnemplyrinfo.user_nm IS '사용자명';
COMMENT ON COLUMN public.comtnemplyrinfo.password IS '비밀번호';
COMMENT ON COLUMN public.comtnemplyrinfo.empl_no IS '사원번호';
COMMENT ON COLUMN public.comtnemplyrinfo.ihidnum IS '주민등록번호';
COMMENT ON COLUMN public.comtnemplyrinfo.sexdstn_code IS '성별코드';
COMMENT ON COLUMN public.comtnemplyrinfo.brthdy IS '생일';
COMMENT ON COLUMN public.comtnemplyrinfo.fxnum IS '팩스번호';
COMMENT ON COLUMN public.comtnemplyrinfo.house_adres IS '주택주소';
COMMENT ON COLUMN public.comtnemplyrinfo.password_hint IS '비밀번호힌트';
COMMENT ON COLUMN public.comtnemplyrinfo.password_cnsr IS '비밀번호정답';
COMMENT ON COLUMN public.comtnemplyrinfo.house_end_telno IS '주택끝전화번호';
COMMENT ON COLUMN public.comtnemplyrinfo.area_no IS '지역번호';
COMMENT ON COLUMN public.comtnemplyrinfo.detail_adres IS '상세주소';
COMMENT ON COLUMN public.comtnemplyrinfo.zip IS '우편번호';
COMMENT ON COLUMN public.comtnemplyrinfo.offm_telno IS '사무실전화번호';
COMMENT ON COLUMN public.comtnemplyrinfo.mbtlnum IS '이동전화번호';
COMMENT ON COLUMN public.comtnemplyrinfo.email_adres IS '이메일주소';
COMMENT ON COLUMN public.comtnemplyrinfo.ofcps_nm IS '직위명';
COMMENT ON COLUMN public.comtnemplyrinfo.house_middle_telno IS '주택중간전화번호';
COMMENT ON COLUMN public.comtnemplyrinfo.group_id IS '그룹ID';
COMMENT ON COLUMN public.comtnemplyrinfo.pstinst_code IS '소속기관코드';
COMMENT ON COLUMN public.comtnemplyrinfo.emplyr_sttus_code IS '사용자상태코드';
COMMENT ON COLUMN public.comtnemplyrinfo.esntl_id IS '고유ID';
COMMENT ON COLUMN public.comtnemplyrinfo.crtfc_dn_value IS '인증DN값';
COMMENT ON COLUMN public.comtnemplyrinfo.sbscrb_de IS '가입일자';
COMMENT ON COLUMN public.comtnemplyrinfo.lock_at IS '잠금여부';
COMMENT ON COLUMN public.comtnemplyrinfo.lock_cnt IS '잠금회수';
COMMENT ON COLUMN public.comtnemplyrinfo.lock_last_pnttm IS '잠금최종시점';
COMMENT ON TABLE public.comtnemplyrscrtyestbs IS '사용자보안설정';
COMMENT ON COLUMN public.comtnemplyrscrtyestbs.scrty_dtrmn_trget_id IS '보안설정대상ID';
COMMENT ON COLUMN public.comtnemplyrscrtyestbs.mber_ty_code IS '회원유형코드';
COMMENT ON COLUMN public.comtnemplyrscrtyestbs.author_code IS '권한코드';
COMMENT ON TABLE public.comtnentrprsmber IS '기업회원';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_mber_id IS '기업회원ID';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_se_code IS '기업구분코드';
COMMENT ON COLUMN public.comtnentrprsmber.bizrno IS '사업자등록번호';
COMMENT ON COLUMN public.comtnentrprsmber.jurirno IS '법인등록번호';
COMMENT ON COLUMN public.comtnentrprsmber.cmpny_nm IS '회사명';
COMMENT ON COLUMN public.comtnentrprsmber.cxfc IS '대표이사';
COMMENT ON COLUMN public.comtnentrprsmber.zip IS '우편번호';
COMMENT ON COLUMN public.comtnentrprsmber.adres IS '주소';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_middle_telno IS '기업중간전화번호';
COMMENT ON COLUMN public.comtnentrprsmber.fxnum IS '팩스번호';
COMMENT ON COLUMN public.comtnentrprsmber.induty_code IS '업종코드';
COMMENT ON COLUMN public.comtnentrprsmber.applcnt_nm IS '신청인명';
COMMENT ON COLUMN public.comtnentrprsmber.applcnt_ihidnum IS '신청인주민등록번호';
COMMENT ON COLUMN public.comtnentrprsmber.sbscrb_de IS '가입일자';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_mber_sttus IS '기업회원상태';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_mber_password IS '기업회원비밀번호';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_mber_password_hint IS '기업회원비밀번호힌트';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_mber_password_cnsr IS '기업회원비밀번호정답';
COMMENT ON COLUMN public.comtnentrprsmber.group_id IS '그룹ID';
COMMENT ON COLUMN public.comtnentrprsmber.detail_adres IS '상세주소';
COMMENT ON COLUMN public.comtnentrprsmber.entrprs_end_telno IS '기업끝전화번호';
COMMENT ON COLUMN public.comtnentrprsmber.area_no IS '지역번호';
COMMENT ON COLUMN public.comtnentrprsmber.applcnt_email_adres IS '신청자이메일주소';
COMMENT ON COLUMN public.comtnentrprsmber.esntl_id IS '고유ID';
COMMENT ON COLUMN public.comtnentrprsmber.lock_at IS '잠금여부';
COMMENT ON COLUMN public.comtnentrprsmber.lock_cnt IS '잠금회수';
COMMENT ON COLUMN public.comtnentrprsmber.lock_last_pnttm IS '잠금최종시점';
COMMENT ON TABLE public.comtnfile IS '파일속성';
COMMENT ON COLUMN public.comtnfile.atch_file_id IS '첨부파일ID';
COMMENT ON COLUMN public.comtnfile.creat_dt IS '생성일시';
COMMENT ON COLUMN public.comtnfile.use_at IS '사용여부';
COMMENT ON TABLE public.comtnfiledetail IS '파일상세정보';
COMMENT ON COLUMN public.comtnfiledetail.atch_file_id IS '첨부파일ID';
COMMENT ON COLUMN public.comtnfiledetail.file_sn IS '파일순번';
COMMENT ON COLUMN public.comtnfiledetail.file_stre_cours IS '파일저장경로';
COMMENT ON COLUMN public.comtnfiledetail.stre_file_nm IS '저장파일명';
COMMENT ON COLUMN public.comtnfiledetail.orignl_file_nm IS '원파일명';
COMMENT ON COLUMN public.comtnfiledetail.file_extsn IS '파일확장자';
COMMENT ON COLUMN public.comtnfiledetail.file_cn IS '파일내용';
COMMENT ON COLUMN public.comtnfiledetail.file_size IS '파일크기';
COMMENT ON TABLE public.comtngnrlmber IS '일반회원';
COMMENT ON COLUMN public.comtngnrlmber.mber_id IS '회원ID';
COMMENT ON COLUMN public.comtngnrlmber.password IS '비밀번호';
COMMENT ON COLUMN public.comtngnrlmber.password_hint IS '비밀번호힌트';
COMMENT ON COLUMN public.comtngnrlmber.password_cnsr IS '비밀번호정답';
COMMENT ON COLUMN public.comtngnrlmber.ihidnum IS '주민등록번호';
COMMENT ON COLUMN public.comtngnrlmber.mber_nm IS '회원명';
COMMENT ON COLUMN public.comtngnrlmber.zip IS '우편번호';
COMMENT ON COLUMN public.comtngnrlmber.adres IS '주소';
COMMENT ON COLUMN public.comtngnrlmber.area_no IS '지역번호';
COMMENT ON COLUMN public.comtngnrlmber.mber_sttus IS '회원상태';
COMMENT ON COLUMN public.comtngnrlmber.detail_adres IS '상세주소';
COMMENT ON COLUMN public.comtngnrlmber.end_telno IS '끝전화번호';
COMMENT ON COLUMN public.comtngnrlmber.mbtlnum IS '이동전화번호';
COMMENT ON COLUMN public.comtngnrlmber.group_id IS '그룹ID';
COMMENT ON COLUMN public.comtngnrlmber.mber_fxnum IS '회원팩스번호';
COMMENT ON COLUMN public.comtngnrlmber.mber_email_adres IS '회원이메일주소';
COMMENT ON COLUMN public.comtngnrlmber.middle_telno IS '중간전화번호';
COMMENT ON COLUMN public.comtngnrlmber.sbscrb_de IS '가입일자';
COMMENT ON COLUMN public.comtngnrlmber.sexdstn_code IS '성별코드';
COMMENT ON COLUMN public.comtngnrlmber.esntl_id IS '고유ID';
COMMENT ON COLUMN public.comtngnrlmber.lock_at IS '잠금여부';
COMMENT ON COLUMN public.comtngnrlmber.lock_cnt IS '잠금회수';
COMMENT ON COLUMN public.comtngnrlmber.lock_last_pnttm IS '잠금최종시점';
COMMENT ON TABLE public.comtnloginlog IS '접속로그';
COMMENT ON COLUMN public.comtnloginlog.log_id IS '로그ID';
COMMENT ON COLUMN public.comtnloginlog.conect_id IS '접속ID';
COMMENT ON COLUMN public.comtnloginlog.conect_ip IS '접속IP';
COMMENT ON COLUMN public.comtnloginlog.conect_mthd IS '접속방식';
COMMENT ON COLUMN public.comtnloginlog.error_occrrnc_at IS '오류발생여부';
COMMENT ON COLUMN public.comtnloginlog.error_code IS '오류코드';
COMMENT ON COLUMN public.comtnloginlog.creat_dt IS '생성일시';
COMMENT ON TABLE public.comtnloginpolicy IS '로그인정책';
COMMENT ON COLUMN public.comtnloginpolicy.emplyr_id IS '업무사용자ID';
COMMENT ON COLUMN public.comtnloginpolicy.ip_info IS 'IP정보';
COMMENT ON COLUMN public.comtnloginpolicy.dplct_perm_at IS '중복허용여부';
COMMENT ON COLUMN public.comtnloginpolicy.lmtt_at IS '제한여부';
COMMENT ON COLUMN public.comtnloginpolicy.frst_register_id IS '최초등록자ID';
COMMENT ON COLUMN public.comtnloginpolicy.frst_regist_pnttm IS '최초등록시점';
COMMENT ON COLUMN public.comtnloginpolicy.last_updusr_id IS '최종수정자ID';
COMMENT ON COLUMN public.comtnloginpolicy.last_updt_pnttm IS '최종수정시점';
COMMENT ON TABLE public.comtnmenucreatdtls IS '메뉴생성내역';
COMMENT ON COLUMN public.comtnmenucreatdtls.menu_no IS '메뉴번호';
COMMENT ON COLUMN public.comtnmenucreatdtls.author_code IS '권한코드';
COMMENT ON COLUMN public.comtnmenucreatdtls.mapng_creat_id IS '매핑생성ID';
COMMENT ON TABLE public.comtnmenuinfo IS '메뉴정보';
COMMENT ON COLUMN public.comtnmenuinfo.menu_nm IS '메뉴명';
COMMENT ON COLUMN public.comtnmenuinfo.progrm_file_nm IS '프로그램파일명';
COMMENT ON COLUMN public.comtnmenuinfo.menu_no IS '메뉴번호';
COMMENT ON COLUMN public.comtnmenuinfo.upper_menu_no IS '상위메뉴번호';
COMMENT ON COLUMN public.comtnmenuinfo.menu_ordr IS '메뉴순서';
COMMENT ON COLUMN public.comtnmenuinfo.menu_dc IS '메뉴설명';
COMMENT ON COLUMN public.comtnmenuinfo.relate_image_path IS '관계이미지경로';
COMMENT ON COLUMN public.comtnmenuinfo.relate_image_nm IS '관계이미지명';
COMMENT ON TABLE public.comtnorgnztinfo IS '조직정보';
COMMENT ON COLUMN public.comtnorgnztinfo.orgnzt_id IS '조직ID';
COMMENT ON COLUMN public.comtnorgnztinfo.orgnzt_nm IS '조직명';
COMMENT ON COLUMN public.comtnorgnztinfo.orgnzt_dc IS '조직설명';
COMMENT ON TABLE public.comtnprogrmlist IS '프로그램목록';
COMMENT ON COLUMN public.comtnprogrmlist.progrm_file_nm IS '프로그램파일명';
COMMENT ON COLUMN public.comtnprogrmlist.progrm_stre_path IS '프로그램저장경로';
COMMENT ON COLUMN public.comtnprogrmlist.progrm_korean_nm IS '프로그램한글명';
COMMENT ON COLUMN public.comtnprogrmlist.progrm_dc IS '프로그램설명';
COMMENT ON COLUMN public.comtnprogrmlist.url IS 'URL';
COMMENT ON TABLE public.comtnroleinfo IS '롤정보';
COMMENT ON COLUMN public.comtnroleinfo.role_code IS '롤코드';
COMMENT ON COLUMN public.comtnroleinfo.role_nm IS '롤명';
COMMENT ON COLUMN public.comtnroleinfo.role_pttrn IS '롤패턴';
COMMENT ON COLUMN public.comtnroleinfo.role_dc IS '롤설명';
COMMENT ON COLUMN public.comtnroleinfo.role_ty IS '롤유형';
COMMENT ON COLUMN public.comtnroleinfo.role_sort IS '롤정렬';
COMMENT ON COLUMN public.comtnroleinfo.role_creat_de IS '롤생성일';
COMMENT ON TABLE public.comtnroles_hierarchy IS '롤 계층구조';
COMMENT ON COLUMN public.comtnroles_hierarchy.parnts_role IS '부모롤';
COMMENT ON COLUMN public.comtnroles_hierarchy.chldrn_role IS '자식롤';
COMMENT ON TABLE public.comtnsitemap IS '사이트맵';
COMMENT ON COLUMN public.comtnsitemap.mapng_creat_id IS '매핑생성ID';
COMMENT ON COLUMN public.comtnsitemap.creatr_id IS '생성자ID';
COMMENT ON COLUMN public.comtnsitemap.mapng_file_nm IS '매핑파일명';
COMMENT ON COLUMN public.comtnsitemap.mapng_file_path IS '매핑파일경로';
COMMENT ON TABLE public.comtnsyslog IS '시스템로그';
COMMENT ON COLUMN public.comtnsyslog.requst_id IS '요청ID';
COMMENT ON COLUMN public.comtnsyslog.job_se_code IS '업무구분코드';
COMMENT ON COLUMN public.comtnsyslog.instt_code IS '기관코드';
COMMENT ON COLUMN public.comtnsyslog.occrrnc_de IS '발생일';
COMMENT ON COLUMN public.comtnsyslog.rqester_ip IS '요청자IP';
COMMENT ON COLUMN public.comtnsyslog.rqester_id IS '요청자ID';
COMMENT ON COLUMN public.comtnsyslog.trget_menu_nm IS '대상메뉴명';
COMMENT ON COLUMN public.comtnsyslog.svc_nm IS '서비스명';
COMMENT ON COLUMN public.comtnsyslog.method_nm IS '메서드명';
COMMENT ON COLUMN public.comtnsyslog.process_se_code IS '처리구분코드';
COMMENT ON COLUMN public.comtnsyslog.process_co IS '처리수';
COMMENT ON COLUMN public.comtnsyslog.process_time IS '처리시간';
COMMENT ON COLUMN public.comtnsyslog.rspns_code IS '응답코드';
COMMENT ON COLUMN public.comtnsyslog.error_se IS '오류구분';
COMMENT ON COLUMN public.comtnsyslog.error_co IS '오류수';
COMMENT ON COLUMN public.comtnsyslog.error_code IS '오류코드';
COMMENT ON TABLE public.comtnweblog IS '웹로그';
COMMENT ON COLUMN public.comtnweblog.requst_id IS '요청ID';
COMMENT ON COLUMN public.comtnweblog.occrrnc_de IS '발생일';
COMMENT ON COLUMN public.comtnweblog.url IS 'URL';
COMMENT ON COLUMN public.comtnweblog.rqester_id IS '요청자ID';
COMMENT ON COLUMN public.comtnweblog.rqester_ip IS '요청자IP';
COMMENT ON TABLE public.comtssyslogsummary IS '시스템로그요약';
COMMENT ON COLUMN public.comtssyslogsummary.occrrnc_de IS '발생일';
COMMENT ON COLUMN public.comtssyslogsummary.svc_nm IS '서비스명';
COMMENT ON COLUMN public.comtssyslogsummary.method_nm IS '메서드명';
COMMENT ON COLUMN public.comtssyslogsummary.creat_co IS '생성수';
COMMENT ON COLUMN public.comtssyslogsummary.updt_co IS '수정수';
COMMENT ON COLUMN public.comtssyslogsummary.rdcnt IS '조회수';
COMMENT ON COLUMN public.comtssyslogsummary.delete_co IS '삭제수';
COMMENT ON COLUMN public.comtssyslogsummary.outpt_co IS '출력수';
COMMENT ON COLUMN public.comtssyslogsummary.error_co IS '오류수';
COMMENT ON TABLE public.comtsweblogsummary IS '웹로그 요약';
COMMENT ON COLUMN public.comtsweblogsummary.occrrnc_de IS '발생일';
COMMENT ON COLUMN public.comtsweblogsummary.url IS 'URL';
COMMENT ON COLUMN public.comtsweblogsummary.rdcnt IS '조회수';
COMMENT ON TABLE public.ids IS '테이블별아이디';
COMMENT ON COLUMN public.ids.idgen_table_nm IS 'IDGEN테이블명';
COMMENT ON COLUMN public.ids.idgen_next_id IS 'IDGEN다음ID';



