-- 시스템 테이블
CREATE TABLE SYSTEM (
    NO      INT NOT NULL AUTO_INCREMENT,
    REG     VARCHAR(1) DEFAULT 'N',
    LOGIN   VARCHAR(1) DEFAULT 'N',
    NOTICE  VARCHAR(256) DEFAULT '',
    CRT_DATE DATETIME,
    MDF_DATE DATETIME,

    PRIMARY KEY (NO)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8;

-- 참여 테이블
CREATE TABLE DONATION (
    NO      INT NOT NULL AUTO_INCREMENT,
    ID      VARCHAR(64) NOT NULL,
    NAME    VARCHAR(64) NOT NULL,
    RNAME   VARCHAR(64) NOT NULL,
    SUBNAME VARCHAR(64) NOT NULL,
    DATE    DATE NOT NULL,
    AMOUNT  INT NOT NULL,
    CUMUL   INT NOT NULL,
    TOTAL   INT NOT NULL,

    PRIMARY KEY (NO),
    KEY (ID),
    KEY (NAME)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8;

-- 회원 테이블
CREATE TABLE MEMBER (
    NO      INT NOT NULL AUTO_INCREMENT,
    ID      VARCHAR(64) NOT NULL,
    PW      VARCHAR(64) NOT NULL,
    PID     VARCHAR(64) NOT NULL,
    NAME    VARCHAR(64) NOT NULL,
    EMAIL   VARCHAR(64) NOT NULL,
    IP      VARCHAR(64) DEFAULT '',
    PICTURE VARCHAR(64) DEFAULT '',
    IMGSVR  INT(1) DEFAULT 0,
    CONMSG  VARCHAR(256) DEFAULT '',
    GRADE   INT(1) DEFAULT 1,   -- 0:블럭, 1:일반, 2:참여회원, 3:유효회원, 4:특별회원, 5:부운영자, 6:운영자
    REG_NUM INT(3) DEFAULT 0,
    REG_DATE DATETIME,
    BLOCK_NUM INT(3) DEFAULT 0,
    BLOCK_DATE DATETIME,
    QUIT    VARCHAR(1) DEFAULT '',

    PRIMARY KEY (NO),
    KEY (ID),
    KEY (PW)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8;

-- 인증 테이블
CREATE TABLE EMAIL (
    NO      INT NOT NULL AUTO_INCREMENT,
    EMAIL   VARCHAR(64) NOT NULL,
    CODE    VARCHAR(6)  NOT NULL,
    VERIFIED INT(1) DEFAULT 0,
    REG_DATE DATETIME,
    VRF_DATE DATETIME,

    PRIMARY KEY (NO)
) ENGINE=MYISAM DEFAULT CHARSET=UTF8;
