2016. 3. 10. 17:20ㆍ99. 정리전 - IT/15. SQL 따라잡기
exErd 테이블 정의서 템플릿 파일공유
\테이블정의서\인덱스정의서\관계정의서 동시 출력
관련파일을 찾다찾다 없어서 만들어보았습니다(by Donz) 시간낭비했음
사용방법
eclipse exErd플러그인 설치 -> eXERD 메뉴 -> 내보내기 -> 템플릿 -> 좌상단 폴더모양 -> 파일선택 -> 확인 -> 이후실행
출력예제)
1717. 게시판댓글 (TB_BOARD_CMMNT) | ※ 게시판댓글 관련 테이블 |
|
인덱스명 | UIX_TB_BOARD_CMMNT | 유형 | UNIQUE | 구분 | INDEX |
---|
속성명 | 컬럼명 | 데이터 타입 | 정렬 |
---|---|---|---|
댓글순서 | CMMNT_SEQ | NUMBER(5) | ASC |
인덱스명 | PK_TB_BOARD_CMMNT | 유형 | UNIQUE | 구분 | PK |
---|
속성명 | 컬럼명 | 데이터 타입 | 정렬 |
---|---|---|---|
글번호 | SEQ | NUMBER(11) | ASC |
댓글순서 | CMMNT_SEQ | NUMBER(5) | ASC |
(CO)파트너ID | PTNR_ID | VARCHAR(20) | ASC |
관계명 | FK_TB_BOARD_TO_TB_BOARD_CMMNT | 부모 테이블 | TB_BOARD | 자식 테이블 | TB_BOARD_CMMNT |
---|---|---|---|---|---|
식별 유형 | 식별 | 부모 차수 | EXACTLY_ONE | 자식 차수 | ZERO_OR_MORE |
부모 컬럼 | 자식 컬럼 | 데이터 타입 |
---|---|---|
SEQ | SEQ | NUMBER(11) |
PTNR_ID | PTNR_ID | VARCHAR(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