SangMin90 / DocuMgt

0 stars 0 forks source link

테이블 DDL 스크립트 #8

Open SangMin90 opened 3 months ago

SangMin90 commented 3 months ago
SangMin90 commented 3 months ago

자주찾는질문 테이블 DDL 스크립트

현재

CREATE TABLE mgt.request_frequency_question(
    request_frequency_question_id bigint NOT NULL AUTO_INCREMENT,
        request_frequency_category nvarchar(40) NOT NULL,
        request_frequency_title nvarchar(200) NOT NULL,
    request_frequency_contents TINYTEXT NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL ,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
    constraint request_frequency_question_pk primary key(request_frequency_question_id)
);

과거

CREATE TABLE mgt.request_question
(
    request_question_id bigint NOT NULL AUTO_INCREMENT,
    request_company nvarchar(40) NOT NULL,
    request_user nvarchar(20) NOT NULL,
    request_phonenumber nvarchar(20) NULL,
    request_email nvarchar(40) NULL,
    request_contents TINYTEXT,
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL ,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
    CONSTRAINT request_question_pk PRIMARY KEY (request_question_id)
);
SangMin90 commented 3 months ago

스키마 생성 DDL

CREATE DATABASE IF NOT EXISTS mgt
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
SangMin90 commented 3 months ago

명함관리 테이블 DDL

CREATE TABLE mgt.business_card
(
    business_card_id bigint(20) not null auto_increment,
    business_name nvarchar(40),
    business_com nvarchar(40),
    business_dept nvarchar(40),
    business_position nvarchar(40),
    project_name nvarchar(40),
    business_contact nvarchar(15),
    business_phone_number nvarchar(12),
    business_email nvarchar(254),
    business_address nvarchar(512),
    card_image_url nvarchar(256),
    reg_user_id nvarchar(40),
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40),
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint business_card_pk primary key(business_card_id)
);
SangMin90 commented 3 months ago

공지사항 테이블 DDL

CREATE TABLE mgt.notice
(
    notice_id bigint(20) not null auto_increment,
    notice_user_id nvarchar(20),
    notice_gubun_code nvarchar(40),
    notice_title nvarchar(40),
    notice_content tinytext,
    notice_popup_flag char(1) NOT NULL DEFAULT 'N',
    notice_begin_date datetime,
    notice_end_date datetime,
    reg_user_id nvarchar(40),
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40),
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint notice_pk primary key(notice_id)
);
SangMin90 commented 3 months ago

직원정보 테이블 DDL

CREATE TABLE mgt.employee
(
    employee_id bigint(20) not null auto_increment,
    company_id bigint(20) NOT NULL,
    employee_email nvarchar(20),
    employee_contact nvarchar(15),
    employee_phone_num nvarchar(12),
    employee_name nvarchar(40),
    employee_position nvarchar(40),
    role_id bigint(40) NOT NULL,
    employee_status_code nvarchar(20),
    employee_use_flag char(1) NOT NULL DEFAULT 'N',
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint employee_pk primary key(employee_id)
);
SangMin90 commented 3 months ago

메뉴정보 테이블 DDL

CREATE TABLE mgt.menu
(
    menu_id bigint(20) not null auto_increment,
    menu_name nvarchar(40) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint menu_pk primary key(menu_id)
);
SangMin90 commented 3 months ago

기능정보 테이블 DDL

CREATE TABLE mgt.feature
(
    feature_id bigint(20) not null auto_increment,
    menu_id bigint(40) NOT NULL,
    feature_name nvarchar(40) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint feature_pk primary key(feature_id)
);
SangMin90 commented 3 months ago

권한 테이블 DDL

CREATE TABLE mgt.roles
(
    role_id bigint(20) not null auto_increment,
    role_name nvarchar(40) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint roles_pk primary key(role_id)
);
SangMin90 commented 3 months ago

메뉴권한매핑 테이블 DDL

CREATE TABLE mgt.menu_roles_mapping
(
    id bigint(20) not null auto_increment,
    menu_id bigint(20) NOT NULL,
    role_id bigint(20) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint menu_roles_mapping_pk primary key(id)
);
SangMin90 commented 3 months ago

키워드 테이블 DDL

CREATE TABLE mgt.keyword
(
    keyword_id bigint(20) not null auto_increment,
    keyword_name nvarchar(40) NOT NULL,
    keyword_desc TINYTEXT NOT NULL,
    keyword_use_flag char(1) NOT NULL DEFAULT 'N',
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint keyword_pk primary key(keyword_id)
);
SangMin90 commented 3 months ago

문서정보 테이블 DDL

CREATE TABLE mgt.document
(
    document_id bigint(20) not null auto_increment,
    project_id bigint(20),
    project_se_code nvarchar(40) NOT NULL,
    attach_file_id bigint(20),
    document_desc TINYTEXT,
    keyword_id bigint(20),
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint document_pk primary key(document_id)
);
SangMin90 commented 3 months ago

문서정보이력 테이블 DDL

CREATE TABLE mgt.document_history
(
    document_history_id bigint(20) not null auto_increment,
    document_id bigint(20) not null,
    project_id bigint(20),
    project_se_code nvarchar(40) NOT NULL,
    attach_file_id bigint(20),
    document_desc TINYTEXT,
    keyword_id bigint(20),
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint document_history_pk primary key(document_history_id)
);
SangMin90 commented 3 months ago

첨부파일 테이블 DDL

CREATE TABLE mgt.attach_file
(
    attach_file_id bigint(20) not null auto_increment,
    orginal_attach_file_name nvarchar(256) not null,
    attach_file_name nvarchar(256) not null,
    attach_file_path nvarchar(256) NOT NULL,
    attach_file_size numeric(14) NOT NULL,
    attach_file_extension nvarchar(256) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint attach_file_pk primary key(attach_file_id)
);
SangMin90 commented 3 months ago

첨부파일이력 테이블 DDL

CREATE TABLE mgt.attach_file_history
(
    attach_file_history_id bigint(20) not null auto_increment,
    attach_file_id bigint(20) not null,
    orginal_attach_file_name nvarchar(256) not null,
    attach_file_name nvarchar(256) not null,
    attach_file_path nvarchar(256) NOT NULL,
    attach_file_size numeric(14) NOT NULL,
    attach_file_extension nvarchar(256) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint attach_file_history_pk primary key(attach_file_history_id)
);
SangMin90 commented 3 months ago

공통그룹코드 테이블 DDL

CREATE TABLE mgt.common_group_code
(
    common_group_code_id bigint(20) not null auto_increment,
    common_group_code_name nvarchar(256) not null,
    common_group_code_desc TINYTEXT NOT NULL,
    use_flag char(1) NOT NULL,
    remark TINYTEXT NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint common_group_code_pk primary key(common_group_code_id)
);
SangMin90 commented 3 months ago

공통코드 테이블 DDL

CREATE TABLE mgt.common_code
(
    common_code_id bigint(20) not null auto_increment,
    common_group_code_id bigint(20) not null,
    common_code_name nvarchar(256) not null,
    sort_order int(3) NOT NULL,
    common_code_desc TINYTEXT NOT NULL,
    use_flag char(1) NOT NULL,
    remark TINYTEXT NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint common_code_pk primary key(common_code_id)
);
SangMin90 commented 3 months ago

게시글 테이블 DDL

CREATE TABLE mgt.board_post
(
    board_post_id bigint(20) not null auto_increment,
    board_post_type_code char(3) not null,
    board_post_title nvarchar(100) not null,
    board_post_content TINYTEXT NOT NULL,
    writer_id nvarchar(40) NOT NULL,
    like_count int NOT NULL,
    dislike_count int NOT NULL,
    blind_flag char(1) NOT NULL,
    delete_flag char(1) NOT NULL,   
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint board_post_pk primary key(board_post_id)
);
SangMin90 commented 3 months ago

댓글 테이블 DDL

CREATE TABLE mgt.post_comment
(
    post_comment_id bigint(20) not null auto_increment,
    board_post_id bigint(20) not null,
    up_post_comment_id bigint(20),
    comment_content TINYTEXT NOT NULL,
    writer_id nvarchar(40) NOT NULL,
    like_count int NOT NULL,
    dislike_count int NOT NULL,
    blind_flag char(1) NOT NULL,
    delete_flag char(1) NOT NULL,   
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint post_comment_pk primary key(post_comment_id)
);
SangMin90 commented 3 months ago

공통표준단어 DDL

CREATE TABLE mgt.cmm_std_word (
  id bigint NOT NULL AUTO_INCREMENT,
  word_name varchar(40) NOT NULL,
  eng_word_name varchar(40) NOT NULL,
  word_desc tinytext,
  reg_user_id varchar(40) NOT NULL,
  reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  mdfr_user_id varchar(40) NOT NULL,
  mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  CONSTRAINT cmm_std_word_pk PRIMARY KEY (id)
)
taejong1086 commented 2 months ago

24.4.16 전체 백업용


CREATE DATABASE IF NOT EXISTS mgt
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE mgt.request_question
(
    request_question_id bigint NOT NULL AUTO_INCREMENT,
    request_company nvarchar(40) NOT NULL,
    request_user nvarchar(20) NOT NULL,
    request_phonenumber nvarchar(20) NULL,
    request_email nvarchar(40) NULL,
    request_contents TINYTEXT,
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL ,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
    CONSTRAINT request_question_pk PRIMARY KEY (request_question_id)
);

show databases;

CREATE TABLE mgt.business_card
(
    business_card_id bigint(20) not null auto_increment,
    business_name nvarchar(40),
    business_com nvarchar(40),
    business_dept nvarchar(40),
    business_position nvarchar(40),
    project_name nvarchar(40),
    business_contact nvarchar(15),
    business_phone_number nvarchar(12),
    business_email nvarchar(254),
    business_address nvarchar(512),
    card_image_url nvarchar(256),
    reg_user_id nvarchar(40),
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40),
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint business_card_pk primary key(business_card_id)
);

CREATE TABLE mgt.notice
(
notice_id bigint(20) not null auto_increment,
notice_user_id nvarchar(20),
notice_gubun_code nvarchar(40),
notice_title nvarchar(40),
notice_content tinytext,
notice_popup_flag char(1) NOT NULL DEFAULT 'N',
notice_begin_date datetime,
notice_end_date datetime,
reg_user_id nvarchar(40),
reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
mdfr_user_id nvarchar(40),
mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
constraint notice_pk primary key(notice_id);

직원정보 테이블 DDL

CREATE TABLE mgt.employee
(
employee_id bigint(20) not null auto_increment,
company_id bigint(20) NOT NULL,
employee_email nvarchar(20),
employee_contact nvarchar(15),
employee_phone_num nvarchar(12),
employee_name nvarchar(40),
employee_position nvarchar(40),
role_id bigint(40) NOT NULL,
reg_user_id nvarchar(40) NOT NULL,
reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
mdfr_user_id nvarchar(40) NOT NULL,
mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
constraint employee_pk primary key(employee_id)
);

CREATE TABLE mgt.employee
(
employee_id bigint(20) not null auto_increment,
company_id bigint(20) NOT NULL,
employee_email nvarchar(20),
employee_contact nvarchar(15),
employee_phone_num nvarchar(12),
employee_name nvarchar(40),
employee_position nvarchar(40),
role_id bigint(40) NOT NULL,
employee_status_code nvarchar(20),
employee_use_flag char(1) NOT NULL DEFAULT 'N',
reg_user_id nvarchar(40) NOT NULL,
reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
mdfr_user_id nvarchar(40) NOT NULL,
mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
constraint employee_pk primary key(employee_id)
);

CREATE TABLE mgt.menu
(
menu_id bigint(20) not null auto_increment,
menu_name nvarchar(40) NOT NULL,
reg_user_id nvarchar(40) NOT NULL,
reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
mdfr_user_id nvarchar(40) NOT NULL,
mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
constraint menu_pk primary key(menu_id)
);

CREATE TABLE mgt.feature
(
feature_id bigint(20) not null auto_increment,
menu_id bigint(40) NOT NULL,
feature_name nvarchar(40) NOT NULL,
reg_user_id nvarchar(40) NOT NULL,
reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
mdfr_user_id nvarchar(40) NOT NULL,
mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
constraint feature_pk primary key(feature_id)
);

CREATE TABLE mgt.roles
(
    role_id bigint(20) not null auto_increment,
    role_name nvarchar(40) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint roles_pk primary key(role_id)
);

CREATE TABLE mgt.menu_roles_mapping
(
    id bigint(20) not null auto_increment,
    menu_id bigint(20) NOT NULL,
    role_id bigint(20) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint menu_roles_mapping_pk primary key(id)
);

CREATE TABLE mgt.keyword
(
    keyword_id bigint(20) not null auto_increment,
    keyword_name nvarchar(40) NOT NULL,
    keyword_desc TINYTEXT NOT NULL,
    keyword_use_flag char(1) NOT NULL DEFAULT 'N',
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint keyword_pk primary key(keyword_id)
);

CREATE TABLE mgt.document
(
    document_id bigint(20) not null auto_increment,
    project_id bigint(20),
    project_se_code nvarchar(40) NOT NULL,
    attach_file_id bigint(20),
    document_desc TINYTEXT,
    keyword_id bigint(20),
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint document_pk primary key(document_id)
);

CREATE TABLE mgt.document_history
(
    document_history_id bigint(20) not null auto_increment,
    document_id bigint(20) not null,
    project_id bigint(20),
    project_se_code nvarchar(40) NOT NULL,
    attach_file_id bigint(20),
    document_desc TINYTEXT,
    keyword_id bigint(20),
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint document_history_pk primary key(document_history_id)
);

CREATE TABLE mgt.attach_file
(
    attach_file_id bigint(20) not null auto_increment,
    orginal_attach_file_name nvarchar(256) not null,
    attach_file_name nvarchar(256) not null,
    attach_file_path nvarchar(256) NOT NULL,
    attach_file_size numeric(14) NOT NULL,
    attach_file_extension nvarchar(256) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint attach_file_pk primary key(attach_file_id)
);

CREATE TABLE mgt.attach_file_history
(
    attach_file_history_id bigint(20) not null auto_increment,
    attach_file_id bigint(20) not null,
    orginal_attach_file_name nvarchar(256) not null,
    attach_file_name nvarchar(256) not null,
    attach_file_path nvarchar(256) NOT NULL,
    attach_file_size numeric(14) NOT NULL,
    attach_file_extension nvarchar(256) NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint attach_file_history_pk primary key(attach_file_history_id)
);

CREATE TABLE mgt.common_group_code
(
    common_group_code_id bigint(20) not null auto_increment,
    common_group_code_name nvarchar(256) not null,
    common_group_code_desc TINYTEXT NOT NULL,
    use_flag char(1) NOT NULL,
    remark TINYTEXT NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint common_group_code_pk primary key(common_group_code_id)
);

CREATE TABLE mgt.common_code
(
    common_code_id bigint(20) not null auto_increment,
    common_group_code_id bigint(20) not null,
    common_code_name nvarchar(256) not null,
    sort_order int(3) NOT NULL,
    common_code_desc TINYTEXT NOT NULL,
    use_flag char(1) NOT NULL,
    remark TINYTEXT NOT NULL,
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint common_code_pk primary key(common_code_id)
);

CREATE TABLE mgt.board_post
(
    board_post_id bigint(20) not null auto_increment,
    board_post_type_code char(3) not null,
    board_post_title nvarchar(100) not null,
    board_post_content TINYTEXT NOT NULL,
    writer_id nvarchar(40) NOT NULL,
    like_count int NOT NULL,
    dislike_count int NOT NULL,
    blind_flag char(1) NOT NULL,
    delete_flag char(1) NOT NULL,   
    reg_user_id nvarchar(40) NOT NULL,
        reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
        mdfr_user_id nvarchar(40) NOT NULL,
        mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint board_post_pk primary key(board_post_id)
);

CREATE TABLE mgt.post_comment
(
    post_comment_id bigint(20) not null auto_increment,
    board_post_id bigint(20) not null,
    up_post_comment_id bigint(20),
    comment_content TINYTEXT NOT NULL,
    writer_id nvarchar(40) NOT NULL,
    like_count int NOT NULL,
    dislike_count int NOT NULL,
    blind_flag char(1) NOT NULL,
    delete_flag char(1) NOT NULL,   
    reg_user_id nvarchar(40) NOT NULL,
    reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mdfr_user_id nvarchar(40) NOT NULL,
    mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    constraint post_comment_pk primary key(post_comment_id)
);

CREATE TABLE mgt.cmm_std_word (
  id bigint NOT NULL AUTO_INCREMENT,
  word_name varchar(40) NOT NULL,
  eng_word_name varchar(40) NOT NULL,
  word_desc tinytext,
  reg_user_id varchar(40) NOT NULL,
  reg_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  mdfr_user_id varchar(40) NOT NULL,
  mdfr_dt datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  CONSTRAINT cmm_std_word_pk PRIMARY KEY (id)
);