결국 리버스 모델링으로 결정하였다.
그렇다고 리모트로 연결할 MYSQL 도 없으니 mysql 을 직접 깔아서 리버스 하기로 하였다.
http://www.mysql.com/ ==> MYSQL 공식 홈에서 다음과 같이 툴을 다운받아 설치하였다.
디비와 리버스 도구는 준비 되었고.. 스키마는 당연히 태터툴즈 setup.php 에서 가져 왔다.
전문스크립트
CREATE TABLE Attachments (
owner int(11) NOT NULL default '0',
parent int(11) NOT NULL default '0',
name varchar(32) NOT NULL default '',
label varchar(64) NOT NULL default '',
mime varchar(32) NOT NULL default '',
size int(11) NOT NULL default '0',
width int(11) NOT NULL default '0',
height int(11) NOT NULL default '0',
attached int(11) NOT NULL default '0',
downloads int(11) NOT NULL default '0',
enclosure tinyint(1) NOT NULL default '0',
PRIMARY KEY (owner,name)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE BlogSettings (
owner int(11) NOT NULL default '0',
name varchar(32) NOT NULL default '',
secondaryDomain varchar(64) NOT NULL default '',
defaultDomain int(1) NOT NULL default '0',
url varchar(80) NOT NULL default '',
title varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
logo varchar(64) NOT NULL default '',
logoLabel varchar(255) NOT NULL default '',
logoWidth int(11) NOT NULL default '0',
logoHeight int(11) NOT NULL default '0',
useSlogan int(1) NOT NULL default '1',
entriesOnPage int(11) NOT NULL default '10',
entriesOnList int(11) NOT NULL default '10',
entriesOnRSS int(11) NOT NULL default '10',
publishWholeOnRSS int(1) NOT NULL default '1',
allowWriteOnGuestbook int(1) NOT NULL default '1',
allowWriteDoubleCommentOnGuestbook char(1) NOT NULL default '1',
language VARCHAR(5) NOT NULL DEFAULT 'en',
timezone VARCHAR(32) NOT NULL DEFAULT 'GMT',
PRIMARY KEY (owner),
UNIQUE KEY name (name)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE BlogStatistics (
owner int(11) NOT NULL default '0',
visits int(11) NOT NULL default '0',
PRIMARY KEY (owner)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Categories (
owner int(11) NOT NULL default '0',
id int(11) NOT NULL auto_increment,
parent int(11) default NULL,
name varchar(127) NOT NULL default '',
priority int(11) NOT NULL default '0',
entries int(11) NOT NULL default '0',
entriesInLogin int(11) NOT NULL default '0',
label varchar(255) NOT NULL default '',
PRIMARY KEY (id),
KEY owner (owner)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Comments (
owner int(11) NOT NULL default '0',
replier int(11) default NULL,
id int(11) NOT NULL auto_increment,
entry int(11) NOT NULL default '0',
parent int(11) default NULL,
name varchar(80) NOT NULL default '',
password varchar(32) NOT NULL default '',
homepage varchar(80) NOT NULL default '',
secret int(1) NOT NULL default '0',
comment text NOT NULL,
ip varchar(15) NOT NULL default '',
written int(11) NOT NULL default '0',
PRIMARY KEY (id),
KEY owner (owner),
KEY entry (entry),
KEY parent (parent)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE CommentsNotified (
owner int(11) NOT NULL default '0',
replier int(11) default NULL,
id int(11) NOT NULL auto_increment,
entry int(11) NOT NULL default '0',
parent int(11) default NULL,
name varchar(80) NOT NULL default '',
password varchar(32) NOT NULL default '',
homepage varchar(80) NOT NULL default '',
secret int(1) NOT NULL default '0',
comment text NOT NULL,
ip varchar(15) NOT NULL default '',
written int(11) NOT NULL default '0',
modified int(11) NOT NULL default '0',
siteId int(11) NOT NULL default '0',
isNew int(1) NOT NULL default '1',
url varchar(255) NOT NULL default '',
remoteId int(11) NOT NULL default '0',
entryTitle varchar(255) NOT NULL default '',
entryUrl varchar(255) NOT NULL default '',
PRIMARY KEY (id),
KEY owner (owner),
KEY entry (entry)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE CommentsNotifiedQueue (
owner int(11) NOT NULL default '0',
id int(11) NOT NULL auto_increment,
commentId int(11) NOT NULL default '0',
sendStatus int(1) NOT NULL default '0',
checkDate int(11) NOT NULL default '0',
written int(11) NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY commentId (commentId)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE CommentsNotifiedSiteInfo (
id int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
url varchar(255) NOT NULL default '',
modified int(11) NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY url (url),
UNIQUE KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE DailyStatistics (
owner int(11) NOT NULL default '0',
date int(11) NOT NULL default '0',
visits int(11) NOT NULL default '0',
PRIMARY KEY (owner,date)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Entries (
owner int(11) NOT NULL default '0',
id int(11) NOT NULL auto_increment,
draft tinyint(1) NOT NULL default '0',
visibility tinyint(4) NOT NULL default '0',
category int(11) NOT NULL default '0',
title varchar(255) NOT NULL default '',
slogan varchar(255) NOT NULL default '',
content mediumtext NOT NULL,
location varchar(255) NOT NULL default '/',
password varchar(32) default NULL,
acceptComment int(1) NOT NULL default '1',
acceptTrackback int(1) NOT NULL default '1',
published int(11) NOT NULL default '0',
created int(11) NOT NULL default '0',
modified int(11) NOT NULL default '0',
comments int(11) NOT NULL default '0',
trackbacks int(11) NOT NULL default '0',
PRIMARY KEY (owner, id, draft),
KEY owner (owner),
KEY category (category)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE FeedGroupRelations (
owner int(11) NOT NULL default '0',
feed int(11) NOT NULL default '0',
groupId int(11) NOT NULL default '0',
PRIMARY KEY (owner,feed,groupId)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE FeedGroups (
owner int(11) NOT NULL default '0',
id int(11) NOT NULL default '0',
title varchar(255) NOT NULL default '',
PRIMARY KEY (owner,id)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE FeedItems (
id int(11) NOT NULL auto_increment,
feed int(11) NOT NULL default '0',
author varchar(255) NOT NULL default '',
permalink varchar(255) NOT NULL default '',
title varchar(255) NOT NULL default '',
description text NOT NULL,
tags varchar(255) NOT NULL default '',
enclosure varchar(255) NOT NULL default '',
written int(11) NOT NULL default '0',
PRIMARY KEY (id),
KEY feed (feed),
KEY written (written),
KEY permalink (permalink)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE FeedReads (
owner int(11) NOT NULL default '0',
item int(11) NOT NULL default '0',
PRIMARY KEY (owner,item)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE FeedSettings (
owner int(11) NOT NULL default '0',
updateCycle int(11) NOT NULL default '120',
feedLife int(11) NOT NULL default '30',
loadImage int(11) NOT NULL default '1',
allowScript int(11) NOT NULL default '1',
newWindow int(11) NOT NULL default '1',
PRIMARY KEY (owner)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE FeedStarred (
owner int(11) NOT NULL default '0',
item int(11) NOT NULL default '0',
PRIMARY KEY (owner,item)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Feeds (
id int(11) NOT NULL auto_increment,
xmlURL varchar(255) NOT NULL default '',
blogURL varchar(255) NOT NULL default '',
title varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
language varchar(5) NOT NULL default 'en-US',
modified int(11) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Filters (
id int(11) NOT NULL auto_increment,
owner int(11) NOT NULL default '0',
type enum('content','ip','name','url') NOT NULL default 'content',
pattern varchar(255) NOT NULL default '',
PRIMARY KEY (id),
UNIQUE KEY owner (owner, type, pattern)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Links (
owner int(11) NOT NULL default '0',
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
url varchar(255) NOT NULL default '',
rss varchar(255) NOT NULL default '',
written int(11) NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY owner (owner,url)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Personalization (
owner int(11) NOT NULL default '0',
rowsPerPage tinyint(4) NOT NULL default '10',
readerPannelVisibility int(11) NOT NULL default '1',
readerPannelHeight int(11) NOT NULL default '150',
lastVisitNotifiedPage varchar(11) default NULL,
PRIMARY KEY (owner)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Plugins (
owner int(11) NOT NULL default '0',
name varchar(255) NOT NULL default '',
settings text,
PRIMARY KEY (owner,name)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE RefererLogs (
owner int(11) NOT NULL default '0',
host varchar(64) NOT NULL default '',
url varchar(255) NOT NULL default '',
referred int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE RefererStatistics (
owner int(11) NOT NULL default '0',
host varchar(64) NOT NULL default '',
count int(11) NOT NULL default '0',
PRIMARY KEY (owner,host)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE ReservedWords (
word varchar(16) NOT NULL default '',
PRIMARY KEY (word)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE SessionVisits (
id varchar(32) NOT NULL default '',
address varchar(15) NOT NULL default '',
blog int(11) NOT NULL default '0',
PRIMARY KEY (id,address,blog)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Sessions (
id varchar(32) NOT NULL default '',
address varchar(15) NOT NULL default '',
userid int(11) default NULL,
preexistence int(11) default NULL,
data text default NULL,
server varchar(64) NOT NULL default '',
request varchar(255) NOT NULL default '',
referer varchar(255) NOT NULL default '',
timer float NOT NULL default '0',
created int(11) NOT NULL default '0',
updated int(11) NOT NULL default '0',
PRIMARY KEY (id,address)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE SkinSettings (
owner int(11) NOT NULL default '0',
skin varchar(32) NOT NULL default 'Tattertools_skyline_ko',
entriesOnRecent int(11) NOT NULL default '10',
commentsOnRecent int(11) NOT NULL default '10',
commentsOnGuestbook int(11) NOT NULL default '5',
tagsOnTagbox tinyint(4) NOT NULL default '10',
tagboxAlign tinyint(4) NOT NULL default '1',
trackbacksOnRecent int(11) NOT NULL default '5',
expandComment int(1) NOT NULL default '1',
expandTrackback int(1) NOT NULL default '1',
recentNoticeLength int(11) NOT NULL default '30',
recentEntryLength int(11) NOT NULL default '30',
recentCommentLength int(11) NOT NULL default '30',
recentTrackbackLength int(11) NOT NULL default '30',
linkLength int(11) NOT NULL default '30',
showListOnCategory int(1) NOT NULL default '1',
showListOnArchive int(1) NOT NULL default '1',
tree varchar(32) NOT NULL default 'base',
colorOnTree varchar(6) NOT NULL default '000000',
bgColorOnTree varchar(6) NOT NULL default '',
activeColorOnTree varchar(6) NOT NULL default 'FFFFFF',
activeBgColorOnTree varchar(6) NOT NULL default '00ADEF',
labelLengthOnTree int(11) NOT NULL default '30',
showValueOnTree int(1) NOT NULL default '1',
PRIMARY KEY (owner)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE TagRelations (
owner int(11) NOT NULL default '0',
tag int(11) NOT NULL default '0',
entry int(11) NOT NULL default '0',
PRIMARY KEY (owner, tag, entry),
KEY owner (owner)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Tags (
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE TrackbackLogs (
owner int(11) NOT NULL default '0',
id int(11) NOT NULL auto_increment,
entry int(11) NOT NULL default '0',
url varchar(255) NOT NULL default '',
written int(11) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Trackbacks (
id int(11) NOT NULL auto_increment,
owner int(11) NOT NULL default '0',
entry int(11) NOT NULL default '0',
url varchar(255) NOT NULL default '',
writer int(11) default NULL,
site varchar(255) NOT NULL default '',
subject varchar(255) NOT NULL default '',
excerpt varchar(255) NOT NULL default '',
ip varchar(15) NOT NULL default '',
written int(11) NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY owner (owner, entry, url)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE Users (
userid int(11) NOT NULL auto_increment,
loginid varchar(64) NOT NULL default '',
password varchar(32) default NULL,
name varchar(32) NOT NULL default '',
created int(11) NOT NULL default '0',
lastLogin int(11) NOT NULL default '0',
host int(11) NOT NULL default '0',
PRIMARY KEY (userid),
UNIQUE KEY loginid (loginid)
) TYPE=MyISAM DEFAULT CHARSET=utf8;
원래는 pre_fix 가 붙는데 생략함;;;;
DbDesigner4 에서 MYSQL 이 제공하는 ODBC 드라이버로 연결하여 ERD 스키마를 가져왔다.
그래서 아주 간편히 나온 결과가 아래의 그림
이제부터는 역시 틈틈히 각 Entity 들의 관계를 유추하여 연결해보는 작업을 해야 겠다.
참고 모델 파일 아직 관계도 안그림
DDL 툴이 있었죠. 미처 생각을 못했는데 저도 참고해야 겠습니다.
답글삭제테이블 필드가 아닌 엔티티 어트리뷰트라는 단어 오래간만에 보네요.
^^ MS기반이면 ODBC가 정말 편하죠 ㅎㅎ 다만 성능은 보장 못한다는 ㅎㅎ
답글삭제trackback from: Hackers Rule and Own. Thats how life goes.
답글삭제제가 예전에 Textcube를 Customize해서 개발하려고 DB를 분석해본적이 있는데요. 혹시 고민하시다가 막히시는게 있으시면 같이 한번 이야기 해보면 어떨까요?
답글삭제뭐.. 그닥 아름답지 못한 DB 였었던 걸로 기억합니다.. ㅎㅎ