[공유] exErd 테이블/인덱스/관계정의서 동시출력 방법

2016. 3. 10. 17:2099. 정리전 - IT/15. SQL 따라잡기



exErd 테이블 정의서 템플릿 파일공유

\테이블정의서\인덱스정의서\관계정의서 동시 출력


관련파일을 찾다찾다 없어서 만들어보았습니다(by Donz) 시간낭비했음


사용방법

eclipse exErd플러그인 설치 -> eXERD 메뉴 -> 내보내기 -> 템플릿 -> 좌상단 폴더모양 -> 파일선택 -> 확인 -> 이후실행



출력예제)


1717. 게시판댓글 (TB_BOARD_CMMNT)※ 게시판댓글 관련 테이블
번호컬럼명속성명도메인데이터타입NULL여부기본값KEY
1SEQ글번호N/ANUMBER(11)Not NullPFK
2CMMNT_SEQ댓글순서N/ANUMBER(5)Not NullPK
3PTNR_ID(CO)파트너IDN/AVARCHAR(20)Not NullPFK
4CMMNT_CONT댓글내용N/AVARCHAR2(4000)
5USR_ID사용자아이디N/AVARCHAR2(20)
6USR_IP사용자아이피N/AVARCHAR2(50)
7USR_PWD사용자비밀번호N/AVARCHAR(255)
8DEL_YN삭제여부N/ACHAR(1)
9CRE_DTIME생성일자N/ADATE
10UPD_DTIME수정일자N/ADATE
11CRE_ID생성아이디N/AVARCHAR2(20)
12UPD_ID수정아이디N/AVARCHAR2(20)
인덱스명UIX_TB_BOARD_CMMNT유형UNIQUE구분INDEX
속성명컬럼명데이터 타입정렬
댓글순서CMMNT_SEQNUMBER(5)ASC
인덱스명PK_TB_BOARD_CMMNT유형UNIQUE구분PK
속성명컬럼명데이터 타입정렬
글번호SEQNUMBER(11)ASC
댓글순서CMMNT_SEQNUMBER(5)ASC
(CO)파트너IDPTNR_IDVARCHAR(20)ASC
관계명FK_TB_BOARD_TO_TB_BOARD_CMMNT부모 테이블TB_BOARD자식 테이블TB_BOARD_CMMNT
식별 유형식별부모 차수EXACTLY_ONE자식 차수ZERO_OR_MORE
부모 컬럼자식 컬럼데이터 타입
SEQSEQNUMBER(11)
PTNR_IDPTNR_IDVARCHAR(20)



템플릿 코드

@begin-doc

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>테이블 정의서(HTML)</title>

<style type="text/css">

<!--

.border0{

width: 1024px;

page-break-before: always;

border: solid 0px white;

}


.entity{

width: 1024px;

margin-bottom: 10px;

page-break-before: always;

}


.entity-header tr td, .entity-header tr th{

text-align: left;

padding-left: 5px;

padding-right: 5px;

vertical-align: top;

}


.entity-header{

border-spacing: 0px;

border-top: solid 2px black;

border-bottom: solid 2px black;

margin:0px;

}


.column-list{

width: 100%;

border-spacing: 0px;

margin: 0px;

border-bottom: solid 2px black;

}


.column-list th{

border-bottom: solid 2px black;

border-top: solid 2px black;

text-align: left;

}


.column-list th, .column-list td{

padding-left: 5px;

padding-right: 5px;

vertical-align: top;

}


.under-line{

border-bottom: solid 1px gray;

}


.right-line{

border-right: solid 1px gray;

}


.left-line{

border-left: solid 1px gray;

}


th{

background-color: #eee;

}




.root {

border-spacing: 0px;

width: 1024px;

}


.under-line {

border-bottom: solid 1px gray;

}


.right-line {

border-right: solid 1px gray;

}


.left-line {

border-left: solid 1px gray;

}


th {

background-color: #eee;

}


.header {

margin-bottom: 0px;

}


.footter {

margin-top: 0px;

margin-bottom: 10px;

border-bottom:solid 2px black;

}


tr.only-first-row td,tr.only-first-row th {

border-top: solid 2px black;

}


tr.first-row td,tr.first-row th {

border-top: solid 2px black;

border-bottom: solid 2px black;

}

tr.last-row td,tr.last-row th {

border-bottom: solid 2px black;

}

-->

</style>

<script type="text/javascript">

var cnt = 1;

</script>

</head>

<body>

<table class="entity" cellpadding="0" cellspacing="0">

<tr>

<td>

<table width="100%" class="entity-header">

<tr>

<th class="under-line right-line" width="70px">작성일</th>

<td class="under-line">2016/03/10</td>

</tr>

<tr>

<th class="under-line right-line">작성자</th>

<td class="under-line">Donz</td>

</tr>

</table>

</td>

</tr>

</table>

<p>

${loop:schema}

</body>

</html>

@end-doc



@begin-schema

${loop:table(index)}

@end-schema


@begin-table

<table class="border0" cellpadding="0" cellspacing="0">

<tr>

<td><font size="5"><b><script type="text/javascript">document.write(cnt++);</script>. ${logicalName} (${physicalName})</b></font></td>

<td align="right"><font size="3">※ ${comment} 관련 테이블</font></td>

</tr>

</table>

<br>

<table class="entity" cellpadding="0" cellspacing="0">

<tr>

<td>

<table class="column-list">

<tr>

<th class="right-line" width="40px">번호</th>

<th class="right-line">컬럼명</th>

<th class="right-line">속성명</th>

<th class="right-line">도메인</th>

<th class="right-line">데이터타입</th>

<th class="right-line">NULL여부</th>

<th class="right-line">기본값</th>

<th>KEY</th>

</tr>

${loop:column}

</table>

</td>

</tr>

</table>

${loop:index}

${loop:foreignkey}

<br><br><br><br>

@end-table



@begin-column

<tr>

<td class="right-line" style="text-align:right;">${columnOrder}</td>

<td class="right-line">${physicalName}</td>

<td class="right-line">${logicalName}</td>

<td class="right-line">${domain}</td>

<td class="right-line">${dataType}</td>

<td class="right-line">${notNull}</td>

<td class="right-line">${defaultValue}</td>

<td>${pfk}</td>

</tr>

@end-column






@begin-index

<table class="root header">

<tr class="first-row">

<th class="right-line">인덱스명</th>

<td class="right-line">${physicalName}</td>

<th class="right-line">유형</th>

<td class="right-line">${uniqueness}</td>

<th class="right-line">구분</th>

<td>${kind}</td>

</tr>

</table>

<table class="root footter">

<tr>

<th class="right-line under-line">속성명</th>

<th class="right-line under-line">컬럼명</th>

<th class="right-line under-line">데이터 타입</th>

<th class="under-line">정렬</th>

</tr>

${loop:index-column}

</table>

@end-index



@begin-index-column

<tr>

<td class="right-line">${logicalName}</td>

<td class="right-line">${physicalName}</td>

<td class="right-line">${dataType}</td>

<td>${sortDirection}</td>

</tr>

@end-index-column






@begin-foreignkey

<table class="root header">

<tr class="only-first-row">

<th class="right-line under-line">관계명</th>

<td class="right-line under-line"">${physicalName}</td>

<th class="right-line under-line"" >부모 테이블</th>

<td class="under-line right-line">${parentTable.physicalName}</td>

<th class="right-line under-line"" >자식 테이블</th>

<td class="under-line">${parent.physicalName}</td>

</tr

<tr class="last-row">

<th class="right-line">식별 유형</th>

<td class="right-line">${identifyKind}</td>

<th class="right-line">부모 차수</th>

<td class="right-line">${parentTable.cardinality}</td>

<th class="right-line">자식 차수</th>

<td>${childTable.cardinality}</td>

</tr>

</table>


<table class="root footter">

<tr>

<th class="right-line under-line">부모 컬럼</th>

<th class="right-line under-line">자식 컬럼</th>

<th class="under-line">데이터 타입</th>

</tr>

${loop:foreignkey-column}

</table>

@end-foreignkey


@begin-foreignkey-column

<tr>

<td class="right-line">${parentColumn.physicalName}</td>

<td class="right-line">${physicalName}</td>

<td>${dataType}</td>

</tr>

@end-foreignkey-column