-- 권한그룹 ↔ 메뉴 매핑 테이블
-- 권한 관리 화면에서 그룹별로 노출 메뉴를 체크박스로 매핑하기 위함

CREATE TABLE IF NOT EXISTS authority_sub_menu (
  objid        numeric PRIMARY KEY,
  master_objid numeric NOT NULL,
  menu_objid   numeric NOT NULL,
  writer       varchar(100),
  regdate      timestamp without time zone DEFAULT now()
);

CREATE INDEX IF NOT EXISTS idx_authority_sub_menu_master ON authority_sub_menu(master_objid);
CREATE INDEX IF NOT EXISTS idx_authority_sub_menu_menu   ON authority_sub_menu(menu_objid);
CREATE UNIQUE INDEX IF NOT EXISTS uq_authority_sub_menu_pair ON authority_sub_menu(master_objid, menu_objid);
